beckham Posted November 8, 2017 Posted November 8, 2017 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
doughemi Posted November 8, 2017 Posted November 8, 2017 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 [ ] 1
Lee Smith Posted November 8, 2017 Posted November 8, 2017 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 1
beckham Posted November 9, 2017 Author Posted November 9, 2017 Thank You for the sample file Lee that helps me understand the options i have much better. kind regards
Recommended Posts
This topic is 2645 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now