Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Date Range Report

Featured Replies

I wrote a script in FM9 that generates a report, narrowing information by user specified date range.

Enter Find Mode

Go to Field (orderdate)

Set Field (orderdate) to DateRange

Set Error Capture On

Perform Find.

Worked great in FM9, doesn't work in FM10. Seems to be a problem with setting the field to the DateRange, which is a calculated field based on a start date and an end date. The calculation results in a field value that is something like 1/1/2008...1/31/2008.

Works if I manually enter it in while in Find mode, but FM10 seems to dislike that format when trying to enter it in to a date field.

Any ideas on how to get around this?

Thank you in advance for any information you may be able to provide.

How is the user specifying the date range? Are they entering Start Date and End Date into global fields? Why not just take them to Find Mode and Pause?

Do you know that you can Find for all January 2008 records by entering 1/*/1998 in Find mode?

You do not need to Go to Field before using Set Field, btw.

Do you know that you can Find for all January 2008 records by entering 1/*/1998 in Find mode?

No, I don't.

Duh, for 2008, you'd enter 2008. Comment, please, I'm old and haven't adjusted yet to the century change, lol.

That wasn't my main point.

http://www.youtube.com/watch?v=QLILrC7Y5L4&feature=fvst

  • Author

Date range is specified by entering a start and end date in to global fields. I usually do not need just one month, but rather a range of months, depending on the report that is being run.

I don't see any purpose in pausing the script, if I can have it do everything it used to do under FM9. And for a user it's easier for them to enter start and end dates, rather than enter find mode, enter a formatted date range, find the results, and then run a script to format the report.

I am not aware of anything new in version 10 that should affect your script. However, you did not tell us anything about how DateRange is calculated, and the description of the problem is rather vague.

I suggest you put a pause in the script right before Perform Find, and examine the actual criteria in the orderdate field.

If all you need is to Find on a date range, then you're right, why put the user in a Find layout, paused, with a button that Resumes and continues on to the report.

But, as Comment says, it's not apparent how you calc DateRange. You need to examine what you have in the OrderDate field when you are in Find. A debug Pause or Modify Last Find will offer a clue.

I'll wait.

  • Author

DateRange is a calculation. = DateStart & "..." & DateEnd. Unstored text--the calculation doesn't work if it's set to result in a date.

For testing, I paused the script, entered a date range "1/1/2009...6/30/2009" and it worked. But if I don't pause the script, there is no value set in the OrderDate field.

  • Author

Problem solved. Thanks for pointing me in the right direction.

Setting the OrderDate field to the value the calculation in the set field step, instead of setting it to a global field that is based on the calculation, allows the script to function correctly.

Thank you very much!

"a global field that is based on the calculation," wonder what you mean by this....

All you need is two globals: gStartDate and gEndDate.

Then a script:

Enter Find Mode

Set Field OrderDate, gStartDate & ".." & gEndDate

Perform Find

You never needed DateRange.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.