Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: How to call previous 24 hours Post Reply Post New Topic
Author Message
coountsr
Newbie
Newbie


Joined: 23 May 2013
Online Status: Offline
Posts: 20
Quote coountsr Replybullet Topic: How to call previous 24 hours
     Posted: 18 Jun 2013 at 5:08am
I am creating a report that will be automated to capture the previous 24 hours of data. Instead of inserting a real date is ther a formula that I can just request the previous 24 hours?
 
Thanks,
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 18 Jun 2013 at 11:29am
If you want the previous 24 hours based on the time the report is run, you can use something like this in the selection formula (click on the formula button in the Select Expert and type this in):
 
{MyTable.DateTimeField} >= (CurrentDateTime - 1) and {MyTable.DateTimeField} <= CurrentDateTime
 
If you want "the previous day", you'll have to do something like this:
 
{MyTable.DateField} = CurrentDate
 
-Dell
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum