evancooney Posted May 12, 2003 Posted May 12, 2003 Hello, I want to compare some dates in a script, and then perform an action based on an IF statement. Here's the pseudocode: IF (date is between date1 and date2) ...perform action... How would I do that in a Filemaker script? Regards, Evan
cmartin Posted May 12, 2003 Posted May 12, 2003 Is the date which you want to compare a field in your database? If so, sounds like you need global fields for date1 and date2. A little more info could be helpful for a more precise script example. -Courtney
EddyB Posted May 12, 2003 Posted May 12, 2003 Hi, This depends on whether you are hardcoding the dates into the script or picking the dates up from 2 fields - here are both ways... I have used an example where it checks a field called TestDate and if it is between 01 Jan 2003 and 31 Dec 2003 it shows a message saying this year, else it shows a message saying Not this Year. Hardcoding the dates in the script: If["TestDate >= Date( 01, 01 , 2003 ) and TestDate <= Date( 12, 31 , 2003 )"] Show Message["This Year"] Else Show Message["Not this Year"] End If Picking the dates up from 2 fields: If["TestDate >= Date( Month ( RangeStartField), Day ( RangeStartField) , Year ( RangeStartField)) and TestDate <= Date( Month ( RandEndField), Day ( RangeEndField) , Year ( RangeEndField) )"] Show Message["This Year"] Else Show Message["Not this Year"] End If Regards Eddy
EddyB Posted May 12, 2003 Posted May 12, 2003 Sorry, yes as Courtney said StartRangeField and EndRangeField should be global fields as date. Eddy
Recommended Posts
This topic is 7869 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