Newbies MW Posted September 15, 2005 Newbies Posted September 15, 2005 Hi all - hope you can help. I'm creating a report in which I want the first step to be to perform a find on a date field to find all dates in the last 30 days. How do I set a find criteria that is effectively 'today...today-30'? Thanks!
-Queue- Posted September 15, 2005 Posted September 15, 2005 Set Field [dateField; "≥" & Get(CurrentDate) - 30]
Newbies MW Posted September 15, 2005 Author Newbies Posted September 15, 2005 Thanks for this - but I can't see how to apply it... Do I create one script step to set the field, then another to perform the find? Every way I've tried to enter this, FM throws up an error... sorry to be dumb, but can you explain how to create the script in FM7 or 8 in a bit more detail? Many thanks!
-Queue- Posted September 15, 2005 Posted September 15, 2005 Sure. Allow User Abort [Off] Set Error Capture [On] Enter Find Mode [ ] Set Field [dateField; "≥" & Get(CurrentDate) - 30] {first parameter is target field; second is calculation} Perform Find [] If [not Get(FoundCount)] Modify Last Find Show Custom Dialog ["No records were found for the given date range."] Show All Records End If
The Shadow Posted September 22, 2005 Posted September 22, 2005 Perhaps, SetField[ dateField, ">=" & GetAsDate( Get(CurrentDate) - 30 )] will work better?
-Queue- Posted September 22, 2005 Posted September 22, 2005 I assume you meant GetAsText, since it is already a date. However, 7 auto-converts the expression, so GetAsText is superfluous.
Recommended Posts
This topic is 7002 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