Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Extracting Date/Time from Date Range Post Reply Post New Topic
Author Message
joyf
Newbie
Newbie


Joined: 13 Apr 2011
Online Status: Offline
Posts: 2
Quote joyf Replybullet Topic: Extracting Date/Time from Date Range
     Posted: 13 Apr 2011 at 3:41am
Hi,
I am still new in creating reports in Crystal. Can someone please help me in creating formula or parameters. I want to create a report where the user provides a date range (ie., March 1 to March 31, 2011) and out of that date range is to extract the dates to every:

Tuesday 5:00pm to 9:00 pm
Thursday 5:00pm to 9:00 pm
Saturday 10:00am to 5:00pm

Please help.

Thanks.


IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 13 Apr 2011 at 4:17am
if i undersatand you correctly you want only records that are on Tu or Th  from 5-9 or Sa from 10-5 between a user defined date range
create 2 date param fields (or one set to accept a range)
and make your select statment as
{table.datetimefield} in {?begin date} to {?end date}
and
(
(dayofweek({table.datetimefield}) in [3,5] and time({table.datetimefield}) in time(17,0,0) to time(21,0,0))
or
(dayofweek({table.datetimefield}) in [7] and time({table.datetimefield}) in time(10,0,0) to time(17,0,0))
)


Edited by DBlank - 13 Apr 2011 at 4:17am
IP IP Logged
joyf
Newbie
Newbie


Joined: 13 Apr 2011
Online Status: Offline
Posts: 2
Quote joyf Replybullet Posted: 13 Apr 2011 at 5:12am
Thank you so much!!! It works perfectly!
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