Jump to content
Server Maintenance This Week. ×

Date Range calculation


This topic is 7258 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This topic is 7258 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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