Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Sorting records for a specific date/time span Post Reply Post New Topic
Author Message
Brat
Newbie
Newbie


Joined: 21 Jun 2008
Location: United States
Online Status: Offline
Posts: 5
Quote Brat Replybullet Topic: Sorting records for a specific date/time span
     Posted: 22 Jun 2008 at 6:05pm
I am trying to figure out how to sort daily records between the hours of 5:00PM - 7:00AM the folowing morning.  It is easy to sort by days, but I am a little confused how to sort a specific time everyday, especially when it spans two days.  Does anyone done this and can send me a copy of the code.  Thanks
IP IP Logged
Magman
Newbie
Newbie


Joined: 24 Jun 2008
Location: United States
Online Status: Offline
Posts: 6
Quote Magman Replybullet Posted: 26 Jun 2008 at 6:10am
I am not really sure this would work but try it with your data: 
 
Create the  Formula Sortime
 
local Datevar x;
 
x := CDate ({DATE_TO_SORT});

if ((CTime ({DATE_TO_SORT})) > CTime (17, 0 , 0) or
    (CTime ({DATE_TO_SORT})) < CTime (7, 0 , 0)  )
then
 
CTime ({DATE_TO_SORT})
 
 
Group By a new Sortime formula.
 
Supress Group Header and Footer.
 
 
In the Details section, use the formula to surpress
 
ISNULL (GroupName ({@Times}, "by second"))
 
 
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