September 15, 200520 yr Newbies 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!
September 15, 200520 yr Author Newbies 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!
September 15, 200520 yr 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
September 22, 200520 yr Perhaps, SetField[ dateField, ">=" & GetAsDate( Get(CurrentDate) - 30 )] will work better?
September 22, 200520 yr I assume you meant GetAsText, since it is already a date. However, 7 auto-converts the expression, so GetAsText is superfluous.
Create an account or sign in to comment