srtackett Posted February 14, 2001 Posted February 14, 2001 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.
john.daly Posted February 14, 2001 Posted February 14, 2001 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
srtackett Posted February 14, 2001 Author Posted February 14, 2001 Awesome -- Thanks. And simple too. Shane
PinnWal Posted February 14, 2001 Posted February 14, 2001 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 :-)
john.daly Posted February 15, 2001 Posted February 15, 2001 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.
Recommended Posts
This topic is 8682 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