EZ Posted February 4, 2007 Posted February 4, 2007 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!
Inky Phil Posted February 4, 2007 Posted February 4, 2007 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
Newbies Duffledorf Posted February 7, 2007 Newbies Posted February 7, 2007 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
Genx Posted February 7, 2007 Posted February 7, 2007 The syntax has nothing to do with you os -- You're on FileMaker version 6, his suggestion was for fm 7+.
Newbies Duffledorf Posted February 7, 2007 Newbies Posted February 7, 2007 Cheers John That solved the problem. Thank you for your help. Duff
mr_vodka Posted February 7, 2007 Posted February 7, 2007 BTW stay away from the Today() function and instead go with Status(CurrentDate)
Newbies Duffledorf Posted February 7, 2007 Newbies Posted February 7, 2007 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
mr_vodka Posted February 7, 2007 Posted February 7, 2007 It is no longer supported as of FM7. Also see here for more info.
Newbies Duffledorf Posted February 8, 2007 Newbies Posted February 8, 2007 Thanks for the info and help. Duff
Recommended Posts
This topic is 6498 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