Solved

More efficient formula to get records for last 24 hours

Posted on 2004-09-26
2
1,594 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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 …
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

630 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