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 a date range via scripting

Featured Replies

To simplify enttry of dates into a Date field on a search screen, I am toying with the idea of buttons on a layout which have "Today","Yesterday", "Last 7 Days", Last 14 days", etc which, when clicked, go to another layout (a search layout) and set the date in the Date field. I am using the SetField Command, so to show dates from the last 7 days I have:

SetField[File:Date;">"&Get(CurrentDate)-7]

Problem: Can the SetField command be made to show a date range e.g. 1.1.2005...3.1.2005?

Frank

Instead "Set field" comand in that case you must put "Insert calc result" comand.

But you must have date field in the layout where you want to search your range.

aaa, in FM7, you can use Set Field[] instead of Insert Calculated Result[] to insert a range for a find.

Frank, I'm not sure what you're asking. Yes, you can use Set Field to insert a range in that format. Did you have trouble with that?

  • Author

Ender

For single dates (e.g. today, yesterday) and SetField example that I included in my first post worked. I think the problem lies in the way that I write the range. I need to do some experimentation e.g "1.1.2005"&"2.3.2005". Will keep you posted on my experimentation!

Frank

Try:

Set Field [ File::Date ; Date(1;1;2005) & "..." & Date(2;3;2005) ]

Thanks, Ender!

  • Author

Thanks Ender - your solution was spot on!

Frank

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.