May 12, 200322 yr 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
May 12, 200322 yr 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
May 12, 200322 yr 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
May 12, 200322 yr Sorry, yes as Courtney said StartRangeField and EndRangeField should be global fields as date. Eddy
Create an account or sign in to comment