Monday, March 19, 2012

Group for each half hour

I am trying to make a report that lists phone calls that are grouped by time (using group export). I can do it by hour using the option "section will be printed: for each hour" but i need it to do it for each half hour and there is no option for that. It is possible do to it? How can i do it (In Crystal Reports 10 or 11)?

Thank you.Create a formula @.half_an_hour:

if minute({table.call_date_time})<30 or
(minute({table.call_date_time})=30 and second({table.call_date_time})=0)
then // returns h:00 - h:30
totext(hour({table.call_date_time}),0)&':00 - '&totext(hour({table.call_date_time}),0)&':30'
else // returns h:31 - h:59
totext(hour({table.call_date_time}),0)&':31 - '&totext(hour({table.call_date_time}),0)&':59'

The formula checks to see if the minute<30
or
is equal to 30 and the second=0 then it returns 'h:00 - h:30' otherwise
'h:31 - h:59'

Group your records on {table.cal_date_time} for each hour, suppress the GH and GF of that group;
then group your records on the {@.half_an_hour} formula.

As the 'Grop2 Name' field returns only time info, you will need to insert the {table.cal_date_time} and to format it as 'Date'.|||Thank you for the reply!! I can now group the calls by half hour.

No comments:

Post a Comment