DavidNPD
asked on
More efficient formula to get records for last 24 hours
I have a report that needs to bring up any records entered in the last 24 hours. This will be evaluated against the current date.
Right now I use 2 formulas to do this, the first is this:
DateDiff ("h", CurrentDateTime,{cfs.rec_d t})
This is called "ulaLast24Hours"
Where cfs.rec_dt is the field that holds the Date and Time of the incident.
and then in the parameters for the report I use this:
{@ulaLast24Hours} > -24.00
This does what I want but seems to be very slow as it goes through the entire database to find the records. What would be a more effiicient method of bringing up the records I need. I am using Crystal Reports Developer 8.5.
Right now I use 2 formulas to do this, the first is this:
DateDiff ("h", CurrentDateTime,{cfs.rec_d
This is called "ulaLast24Hours"
Where cfs.rec_dt is the field that holds the Date and Time of the incident.
and then in the parameters for the report I use this:
{@ulaLast24Hours} > -24.00
This does what I want but seems to be very slow as it goes through the entire database to find the records. What would be a more effiicient method of bringing up the records I need. I am using Crystal Reports Developer 8.5.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
{cfs.rec_dt} in currentdatetime - 1 to currenTdatetime