Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Date range formula? Post Reply Post New Topic
Author Message
Slurm
Newbie
Newbie
Avatar

Joined: 07 Nov 2007
Location: United States
Online Status: Offline
Posts: 8
Quote Slurm Replybullet Topic: Date range formula?
    Posted: 08 Nov 2007 at 4:25am
Hey all,
 
Just ordered the book from Amazon, but in the meantime I have a problem I cant solve with my limited abilities.
 
I've been using Crystal for about 6 months now, and Ive been working on this little problem on the side for a while.
 
Where I work, a day runs from 11pm to 11pm rather then midnight to midnight (which is how Crystal sees a standard day, which makes sense of course). I have a labor report that looks at the previous day's labor. My issue is that the 3rd shift here runs from 11pm to 7am so when the report runs, it only picks up 7 or the 8 hours they worked.
 
Is there a way to make Crystal look at the previous day as 11 to 11? or is there a formula I could use to maybe pull the previous 24 hours, and then set up the report to print at 11:00pm to catch the time im looking for?
 
I tried using something like "TimeVar in Range" but I couldnt figure out what the rest of it should read. (im honestly not great with formulas yet)
 
Any ideas?
 
 
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 08 Nov 2007 at 11:47am
Thanks for buying a book to support the forum. 

Unfortunately, this is a bit of a tough question. To make CR look at the previous day would require all custom formulas. As you said, it would be easier to run the report at 11pm each night and just look at the last 24 hour period, you can use this as your record selection formula:
DateDiff("h", {TestDateTimes.DateEntered}, CurrentDateTime) <= 24;


You can play with the DateDiff() formula if you want to work on 'shifting' the previous day to the 11pm period.

HTH, and check out Chapter 7 of the book for more formulas tips.


Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
Slurm
Newbie
Newbie
Avatar

Joined: 07 Nov 2007
Location: United States
Online Status: Offline
Posts: 8
Quote Slurm Replybullet Posted: 09 Nov 2007 at 7:15am
I think thats what Im looking for. Clap
 
Thanks a bunch!
IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.015 seconds.