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.

Date Range calculation

Featured Replies

I wish to create a NUMBER Field and a DATE field that defaults to the current date then use those fields to perform a calculation that will:

Show all records for the last "X" days where x is the number in the Number field.

thanks

Graham

I'm not sure, what you want. A caclulation can't show records, it calculates a separate result on every record (unless its global).

You would have to do a Find or a GoToRelatedRecords script to show the records you want.

For this you could use a calculation field

c_date = DATE - NUMBER (result formatted as date)

which gives you the smaller value, you need for your range search.

  • Author

Hello

sorry I did not make myself clear

Lets say I have 100 records with a DATE Field (defaults to the creation date)

I want to create a button that will find those records for the last X days....

somehow I would like to automate this so that by simply having an input number I can then view the records for a date range

eg I want to view the records created on the last 5 days..

or the last 7 days or 10 days...... depending on the number that I input into the find

thanks

Graham.

Hello Graham,

What you are describing can b e achieved fairly simply by setting up a script to perform the find according to the number entered.

I am attaching a simple demo (a v7 file) that shows a working model of such a script.

DayRangeFind.zip

  • Author

Thnaks a million! It worked - although I had to deduce to remove the comment /* from each line!

Cheers

Graham

Hi Graham,

Glad to hear that you are on track.

I take it that you imported the script from the file I posted. FWIW, FileMaker 7 maps imported script references to fields according to their names and - if there isn't an exact match, it 'comments out' the relevant syntax. That is likely why you had to remove some /* comment braces. wink.gif

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.