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.

Search for date in multiple date fields

Featured Replies

Im trying to create a script that will search for a specific date range (example: 4-1-03...5-1-03) in two different date fields. I've set up a script that does this in a step one step two process, but I would like to have the user input the date/date range only once. The results would be stored in global fields. here is what I am using now...

Enter Find Mode [ Pause ]

Perform Find [ Replace Found Set ]

Insert Calculated Result [ SFC_Global_1, Status Found Count ]

Enter Find Mode [ Pause ]

Perform Find [ Replace Found Set ]

Insert Calculated Result [ SFC_Global_2, Status Found Count ]

I tried using a combined Calc field, as stated elsewhere in the forums, to combine the two date fields in order to search from it, but I couldn't get the calc field to work properly with displaying two dates.

Any advice would be appreciated!

Have user enter beginning and ending dates in two global fields in Browse Mode.

Go to Layout {with your date fields on it}

Enter Find Mode[]

Insert Calculated Result[ datefield1, g1 & "..." & g2]

New Record/Request

Insert Calculated Result[ datefield2, g1 & "..." & g2]

Perform Find

Hello:

The script you posted seems to have nothing to do with what you are trying to accomplish. Also, what do you mean by "the results will be stored in globals?

Anyways, I will try to answer the question that you posted: "Im trying to create a script that will search for a specific date range (example: 4-1-03...5-1-03) in two different date fields"

There are a few things you will need to define:

1. The date field that you want to search in. I'll call it date.

2. The globals that will hold the range you want to search. I'll call them g_fromDate and g_toDate.

Construct your script:

Go to Layout [Layout with date fields on it]

Enter Find Mode []

Insert Calculated Result [date1, "DateToText(g_fromDate) & "..." & DateToText(g_toDate)

Perform Find []

This will set the field "date" to the range set in the globals g_fromDate and g_toDate. So users will enter the date ranges, then perform the above script.

ken

I was going to reply with that, too JT. But I wasn't sure if he meant there are two date fields to find in, or if the ranges were in two date fields.

I came in 2nd again!

ken

I thought his explanation was too confusing. So instead of trying to interpret his script, I took the lazy route and told him what to do instead. laugh.gif

  • Author

I'm sorry I wasn't able to explain it better. I give your examples a try, thanks for the help!!

  • Author

kenneth2k1, Your script worked. Although I originally wanted the user to just type in a date range in one field (1-1-03...2-2-03) to get a result for two different date fields, your method of using two global fields to represent the beginning and ending dates works fine. Thanks for both of your input!

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.