Jump 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.

Searching between dates

Featured Replies

In a Project database, each employee introduce how many hours he worked in one day in differents projects. I made a report to know the job of each employee in all the projects

Toni:

Welcome to the Forums.

To search for a range of dates, the method is (in find mode, obviously)??? "2/2/2003...7/25/2003". The "..." is what you're after.

-Stanley

  • Author

Thanks a lot. I knowed who to do it manually in find mode

Hi,

You will need to create 2 fields for this. I use g_StartDate adn g_EndDate. To be able to enter a range within a script the dates must first be turned into text. The user will enter the Start date and the End date into the fields.

In your script to enter the dates for a range find you will need to use a caclulated result. The calc will be.

DateToText(g_StartDate) & "..." & DateToText(g_EndDate )

This will combine the start and end date which can be used in your script.

You can use the SetField step or the Insert calulated result right before your perform find step which will be the Calculation above.

HTH

Michael

Hi,

i am trying to do the exact same thing (and am also new to this).

i have a DateofBirth field, and am trying to display a list of records which fall between two dates. I have set up DOB1 abd DOB2 for the range, and then have a script with:

Set Field ["DateofBirth", "DatetoText[DOB1]&"..."&DatetoText[DOB2]"]

Thing is, I dunno what to do next to display this data set!! What else needs to go into this script??

Any help appreciated!!!

Actually, you can't use a Set Field in this instance, since you're setting a date field with a text result. You'll need to use Insert Calculated Result.

If your users are entering the values for DOB1 and DOB2, then

Set Error Capture [On]

Insert Calculated Result [DateofBirth, DateToText(DOB1) & "..." & DateToText(DOB2)]

Perform Find [ ]

If [not Status(CurrentFoundCount)]

Show Message ["No records for the specified date range exist."

Show All Records

End If

If users are not setting the DOB fields, then deselect the Pause option when entering find mode.

Thanx for the reply,

tried as you suggested, and am finding the only record in DateofBirth field which has a no data (actually has a '?' in it). What am I doing wring here?

You said i would need to use Insert Calculated Result. Duh, where?

(Sorry if these are really dumb questions, but I am trying to get around the basics of FM).

Sorry, Queue, Insert Calculated Result is there obviously.

I have tried as you have suggested here, and the script inserts '...' in the DateofBirth field, and then the Find button appears on the left of screen area.

Any clues.

Thanks, Hugh

Argh. Some of my code seems to have vanished.

After setting error capture, enter Find Mode [Pause] (no pause necessary if there's no user intervention). DOB1 and DOB2 should be global fields. If there is no user interaction, set the globals with the result of their calculations, if applicable, in Browse Mode, then enter Find Mode and run the Insert Calculated Result step.

Sorry for the confusion.

Thanx - it works a treat!

Create an account or sign in to comment

Important Information

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

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.