dta Posted November 28, 2008 Share Posted November 28, 2008 I want to perform a find script based on a date field. The date range would be greather than or equal to today's date and less than or equral to today's date plus 30 days. I have been using the "specify" function in the perform constrain found set script, but do not know the proper syntax. All I can do is find records greater than or equal to today using >=//. Can anyone help out with the other part of the equation, the less than or equal to today plus 30 days part? thanks in advance dta Link to comment Share on other sites More sharing options...
aldipalo Posted November 28, 2008 Share Posted November 28, 2008 (edited) Enter Find Mode() //Uncheck Pause set field(Datefield); Get(CurrentDate)-30 &"..."&get(Currentdate) Perform Find() hth In rereading your question I see you want to look at 2 different sets of data. First in the range of the last 30 days and then anything greater than or equal to today. Is it that you want to see both sets of data in the same view? Edited November 28, 2008 by Guest Link to comment Share on other sites More sharing options...
LaRetta Posted November 28, 2008 Share Posted November 28, 2008 The date range would be greather than or equal to today's date and less than or equral to today's date plus 30 days. I read it to mean: Get ( CurrentDate ) & ".." & Get ( CurrentDate ) + 30 Link to comment Share on other sites More sharing options...
dta Posted November 28, 2008 Author Share Posted November 28, 2008 Thanks all. Yes I am looking for a script which queries out data in a date range between today and 30 days from today, based on a date field in the database. LaRetta, I attempted to use the syntax you provided in the constrain found set "specify find requests" using the script maker, by adding it in the criteria window however the system gave me an error message “the field is defined to contain a valid date in the range of years 1 to 4000 and should look like “12/23/2007”. You must enter a valid date.” Link to comment Share on other sites More sharing options...
aldipalo Posted November 28, 2008 Share Posted November 28, 2008 (edited) I believe it should be "..." not".." Get ( CurrentDate ) & "..." & Get ( CurrentDate ) + 30 Edited November 28, 2008 by Guest Link to comment Share on other sites More sharing options...
dta Posted November 28, 2008 Author Share Posted November 28, 2008 Still does not work. I am using the script associated with a button. Under button set up, the system accepted the syntax under optional script parameter. Odd, looked like it was working, but as a test I changed the 30 to 45 and did not get the correct data. Link to comment Share on other sites More sharing options...
aldipalo Posted November 28, 2008 Share Posted November 28, 2008 You need to set up a script not a script parameter. Your button refers to that script and the steps should be: Enter Find Mode() //Uncheck Pause set field(Datefield); Get(CurrentDate)&"..."&get(Currentdate)+30 Perform Find() Link to comment Share on other sites More sharing options...
LaRetta Posted November 28, 2008 Share Posted November 28, 2008 I believe it should be "..." not".." Nope, aldipalo. Both are valid to FileMaker. Dta, the issue is simply that it was specified that you use Set Field[] instead. You cannot use a Find Request with a calculation. Link to comment Share on other sites More sharing options...
aldipalo Posted November 28, 2008 Share Posted November 28, 2008 I'm sorry, I'm not understanding you. Are you saying the poster method is correct? What calculation. I tested my script and it worked perfectly. Please explain. Al Link to comment Share on other sites More sharing options...
LaRetta Posted November 28, 2008 Share Posted November 28, 2008 What you listed is fine and identical to mine except for the "..". I am saying one should use Set Field[] and cannot try putting the calculation within a Find Request. The calculation is simply: Get ( CurrentDate ) & ".." & Get ( CurrentDate ) + 30 The only thing I said to you, Al, was that ".." is legal range as well as "...". :wink2: Link to comment Share on other sites More sharing options...
dta Posted November 28, 2008 Author Share Posted November 28, 2008 Thank you both. Working just fine! Didn't quite realize the required sequence of commands to perform a find. Regards dta Link to comment Share on other sites More sharing options...
aldipalo Posted November 29, 2008 Share Posted November 29, 2008 You see LaRetta, that's why I love this Forum, I'm always learning something new. I thought you'd simply made a typo. I never knew the".." was legal in a range. :yay: Link to comment Share on other sites More sharing options...
LaRetta Posted November 29, 2008 Share Posted November 29, 2008 ...that's why I love this Forum, I'm always learning something new. Indeed! And it is the small surprises that can tickle me the most! As for using "..", it is important to note that it will NOT work is searching for a decimal range such as: greater than .14 but less than .99. The search sets as: .14...99 and FileMaker doesn't know if it is ... range ending value at 99 or .. range and ending value at .99. It assumes 99. I don't consider it a break; after all, how would FM know? But I use ".." because two of the greatest Developers use it. If I'm going to imitate, I imitate the best every chance I get! I particularly like it because it's a bit strange. :mickey: Link to comment Share on other sites More sharing options...
Recommended Posts
This topic is 5766 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