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.

Splitting a Date Range

Featured Replies

In a database we use to record bank deposits there is a date field for when the deposit was made. I have a report to make that just gives details about deposits over a period of time. My issue is this:

The user can input a date range to generate the report. I would like to display the chosen date range in the header of the report. For example, if in the date deposited field the user were to type 07/01/2007...07/31/2007 I would want the following to display in the header of the report:

07/01/2007 - 07/31/2007

I'm sure there's an easy way to do this but I can't seem to find it.

Any ideas?

If your process is scripted, then it would be easier for you to use two global date fields as your start and end dates for your range rather than trying to do it with one field.

If you do it that way, then all your report header has to have is a merge field of <> - <>

  • Author

[color:red]Show Custom Dialog ["Automated Seach"; "Enter the start and end dates for your search:"; YourTable::gStart; YourTable::gEnd]

If [Get(LastMessageChoice) = 2]

Exit Script [ ]

End If

Enter Find Mode [ ]

Set Variable [$Criteria; Value: YourTable::gStart & ".." & YourTable::gEnd]

Set Field [YourTable::DateField01; $Criteria]

Am I on the right track? I'm not sure how to put it in the format I mentioned.

You dont really need the extra set variable step. You could just use set field [YourTable::DateField01; Value: v& ".." & YourTable::gEnd]

Perform Find []

Make sure that you compensate for error trapping and the date fields being empty or invalid. One your layout, you can insert merge field of YourTable::gStart space - space YourTable::gEnd.

  • Author

mr_vodka,

One more newbie question. Can you explain a particular portion of your response?

In the script you said use [YourTable::DateField01; Value: v& ".." & YourTable::gEnd] instead of the final Set Variable section. I understand that but I don't get part of this function you have provided. I've never used or seen "Value: v&". What is that and what does it do?

Thanks so much for your help. It's nice to know there's people like you and everyone else that's aided me in the past that want to help and do so. It has bettered not only my base knowledge but my unit here at work as well.

Thanks.

Sorry that was a copy and paste error from your post.

It should be:

Set Field [YourTable::DateField01; YourTable::gStart & ".." & YourTable::gEnd ]

  • Author

I'm having an issue with my script so if anyone can straighten it out I would be much appreciative. This is the important part of it where the issues lie:

[color:red]Show Custom Dialog ["Automated Seach"; "Enter the start and end dates for your search:"; YourTable::gStart; YourTable::gEnd]

If [Get(LastMessageChoice) = 2]

Exit Script [ ]

End If

Enter Find Mode [ ]

Set Field [YourTable::DateField01; YourTable::gStart& "..." & YourTable::gEnd]

Perform Find

When the report comes up instead of giving me a the date like this, "07/01/2007 - 07/31/2007" I just get the start date.

Now I did try and set a global field after setting the actual date field but the global field only shows up on certain pages, which is just plain weird.

Also, DateField01 is a date field which likely explains why it won't give me the full range on the report but how do I set the script up to search within that field and set another field to display the range?

  • Author

Nevermind!! I got it to work.

Thanks, mr_vodka.

Create an account or sign in to comment

Important Information

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

Account

Navigation

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.