Chuck J Posted October 3, 2005 Posted October 3, 2005 I have a request to find records entered in the last week. There is a Date Entered field. The script I used is: enter find mode insert calculated result Status( CurrentDate) & "..." & (Status( CurrentDate) - 6) perform find My results were not found records but an error message that the date must be in the 1/1/2005 format. When I clicked continue the information in the "Date field" is 732215...732221. Apparently this is Filemaker code for 9/28/05 through 10/2/05. Before I started I entered five records with the 9/28/05 through 12/2/05 dates. In find mode using 9/28/05...10/2/05 returned all five records. I have tried scripts using both Set Field and Insert Calculated Result without success. I confirmed that the DATE field is set as a Date field. I even changed the date format to 1/1/2005 from 1/1/05 just for the heck of it. The "Specify Calculation" says The calculation must be a Date, I just don't know what is going wrong. Do you have any ideas?
Breezer Posted October 3, 2005 Posted October 3, 2005 You will need to use global fields. i) A global calculated field called "gCurrentDate" = status(currentDate) ii)Another global field called "gLastWeekBegin" = status(currentDate)- 6 iii) A global calculated text field which will be a concatenation of i and ii above called "gDateRange" to look like this: = gLastWeekBegin &"..."&gCurrentDate Now write your script as follows: Go to layout (specify the layout that has the field you need to search from) Enter Find Mode Set Field [DateField]; "gDateRange" Perform Find
mr_vodka Posted October 3, 2005 Posted October 3, 2005 Hi Chuck, welcome to the forums. Please do not make it a habit of double posting. Chuck you need to specify the Date to be written as Text. DateToText( (Status( CurrentDate) - 6) ) & "..." & DateToText(Status( CurrentDate)) then your find script will be: Enter Find Mode [] Insert Calculated Result [DateToText( (Status( CurrentDate) - 6) ) & "..." & DateToText(Status( CurrentDate))] Perform Find [Replace Found Set]
Chuck J Posted October 3, 2005 Author Posted October 3, 2005 Thanks John, That was exactly what I needed. I would never have guessed that. Sorry about the double post, I couldn't remember where I posted the message.
Recommended Posts
This topic is 6991 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