February 4, 200718 yr Hi Folks, I have a fairly simple database with one table. One of my fields is 'Date', which is represents the date on which I created the record. I'm trying to write a find script that finds a date range. The date range will almost always be the records between today and the past 7 days. How do I write this? Thanks!
February 4, 200718 yr Hi EZ Your script should be as follows: enter find mode setfield[date;Get(currentdate)-7 & "..." & Get(current date)] perform find The syntax may not be exact but it demonstrates how you set a date field to a range by using date1...date2 Hope that helps Phil
February 7, 200718 yr Newbies Hi Phil I have virtually the same problem as EZ. I note that you are using Windows, I am using OSX on a mac, so the syntax is different. I had reached a similar conclusion to your response, which in mac is Set Field ["datefield", "Today-7 & "..." & Today"]. While this string is acceptable to scriptmaker, the problem seems to be that the datefield will not accept the input and just takes the Today-7 part; (presumably because it is set up as a date field- and even though I have already entered find mode). I am lost for an answer, have you (or any other members) got any suggestions? thanks Duffledorf
February 7, 200718 yr The syntax has nothing to do with you os -- You're on FileMaker version 6, his suggestion was for fm 7+.
February 7, 200718 yr BTW stay away from the Today() function and instead go with Status(CurrentDate)
February 7, 200718 yr Newbies Hi John I had used the today function, as it did seem easier, but on your advice have changed to the status(currentdate) which seems to provide the same result. Any reason for your recommendation? Duff
Create an account or sign in to comment