Solved

More efficient formula to get records for last 24 hours

Posted on 2004-09-26
2
1,401 Views
Last Modified: 2008-03-17
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.


 
0
Comment
Question by:DavidNPD
2 Comments
 
LVL 28

Accepted Solution

by:
bdreed35 earned 50 total points
ID: 12156030
Try this in the Records Selection formula:

{cfs.rec_dt} in currentdatetime - 1 to currendatetime
0
 

Author Comment

by:DavidNPD
ID: 12156272
Thanks, I added the missing "t" and then that worked great.

{cfs.rec_dt} in currentdatetime - 1 to currenTdatetime
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now