Link to home
Start Free TrialLog in
Avatar of DavidNPD
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_dt})

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
Avatar of bdreed35
bdreed35
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of DavidNPD
DavidNPD

ASKER

Thanks, I added the missing "t" and then that worked great.

{cfs.rec_dt} in currentdatetime - 1 to currenTdatetime