rigoletto Posted June 12, 2004 Posted June 12, 2004 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
dbruggmann Posted June 12, 2004 Posted June 12, 2004 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.
rigoletto Posted June 12, 2004 Author Posted June 12, 2004 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.
CobaltSky Posted June 12, 2004 Posted June 12, 2004 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
rigoletto Posted June 13, 2004 Author Posted June 13, 2004 Thnaks a million! It worked - although I had to deduce to remove the comment /* from each line! Cheers Graham
CobaltSky Posted June 13, 2004 Posted June 13, 2004 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.
Recommended Posts
This topic is 7730 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 accountSign in
Already have an account? Sign in here.
Sign In Now