November 8, 20178 yr Hi can anyone offer advise on the best practice to script a find function please? I have a "expiry date field" e.g.: 12/03/2018 and would like to have a script that could show records that fall within 8 weeks before or after the expiry date. Thank you
November 8, 20178 yr Use the Date( ) function to create dates 56 days before and after your expiry date, and use that in the Set Field script step. The Date( ) function takes care of months and years all by itself. Enter Find Mode [ ] Set Field [YourTable::ExpiryDate; Let( [~theDate = YourTable::ExpiryDate; ~start = Date(Month(~theDate); Day(~theDate)-56; Year(~theDate)); ~end = Date(Month(~theDate);Day(~theDate)+56; Year(~theDate)) ]; ~start & "..." & ~end ) Perform Find [ ]
November 8, 20178 yr Hi becham, I would do this with a Conditional Formatting if you only want to view them. Example file shows two different colors, one for past and one for future of the target date. You could use the same color for both fields AnyDate represents your date field (you mentioned in your post). Flag.fmp12
November 9, 20178 yr Author Thank You for the sample file Lee that helps me understand the options i have much better. kind regards
Create an account or sign in to comment