Jump to content

Find expiry date range


This topic is 2357 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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 

Link to comment
Share on other sites

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 [ ]
  • Thanks 1
Link to comment
Share on other sites

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

  • Thanks 1
Link to comment
Share on other sites

This topic is 2357 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.