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.

function

Featured Replies

I have a search layout in which the users enters a date period in a field and after he clicks on a search button opens a report layout with the period the user chose in the search layout.

In the search layout there is a field that is the creation date and the search button has a script that copies to a global field the creation date entered by the user and sets other two global fields with the beginning and the other global field with the ending date.

For that to happen I used the function left and right. It works well if the user typed the date like :P 02/02/02...02/03/02 and for the left function I have left(_gperiod1, 8) and the right function I have right(_gperiod2, 8). The problem is if the user enters a date like 02/02/2002...02/03/2002. I would get as result for the first global field 02/02/20 and for the second global field 02/03/20

Is there a way to use the " ... " as a separator for the global fields and get the two global fields to keep the beginning date and the second global field keep the ending date even not needing to specify a number to count from the left or the right ?

Well I have to say that I'm not sure on what are you doing there, but however here's the answer to your question if you don't mind to use copy and paste:

Enter Find Mode

//do what you have to do

Pause [ ]

Copy [range]

Perform Find

//do what you have to do

Paste [gStartDate, select]

Set Field [gEndDate,"Right(gStartDate, Position(gStartDate, "...", 0, 1)-1)"]

Set Field [gStartDate,"Left(gStartDate, Position(gStartDate, "...", 0, 1)-1)"]

HTH

Dj

If you use begin date and end date global fields, use the follow to setup the find:

Enter Find Mode()

SetField(Date, Begin Date)

Insert Text ("...") <-- Make sure to deselect "Select Entire Contents"

Insert Calculated Result (End Date) <-- Make sure to deselect "Select Entire Contents"

Perform Find()

-bd

I think she was trying to get Start and Stop date from Date Range inserted in Find Mode.

Obviuosly what you are suggesting is the right way to setup find for date range and she should implement it at place of her design.

Just to clarify.

Dj

  • Author

Thanks,

I managed to do it using the functions left, right, length and position

For the start date - Left(Name, Position(Name, " ", 1, 1)-1)

For the end date - Right(Name, Length(Name) - Position(Name, " ", Length(Name), -1))

It worked perfectly. And it is great because I don't need to tell the user what date format he has to enter. He can enter either way , mm/dd/yy or mm/dd/yyyy

Luiza

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.