Jump to content
Sign in to follow this  
srtackett

Finding Dates

Recommended Posts

I am trying to create a report where the user can click a button and bring up a report of all newly created records within the past 7 days.

The only thing I need to know is how to find the correct date range. The range should read: TodaysDate - 7 days to TodaysDate (or >TodaysDate - 7 days.

In FM 3 how does this work? (//-7)..// doesn't do the trick. Can this be done?

Thanks.

Share this post


Link to post
Share on other sites

I do it by having a calculated field to show the days since the record was created (or in my case since a particular check was carried out). The calculation is simply:

Today - Creation Date

You can then find all records with a value >7 in the Days Since Created field

Share this post


Link to post
Share on other sites

John-

If you do the search in the way you explain, won't you have a very long search (especially in a database with a lot of files)? By making the calculation based on the days elapsed field, the search is happening on an unindexable field. If the database had to index the field everytime the report is run, it would probably be very tedious.

Why not just promt the user for the date you want to start from & then have the script find the desired date range?

Just a thought...

Later :-)

Share this post


Link to post
Share on other sites

Good point but I checked and the field and is indexed! It takes less than 4 seconds using a PC with a 133mHz processor and with a database containing 2300 records.

I actually use this field for other purposes as well.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

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