Link to home
Start Free TrialLog in
Avatar of John-S Pretorius
John-S PretoriusFlag for United States of America

asked on

Creating 24 * 1 Hr Groups based on a normal Day

Is it possible to create 24 1Hr. groups based on a normal 24Hr. day  (not any data) and then group my actual data within each one of these Hourly groups ?

So I want to create a formula which I will group on GH1 that will have a header :
00:00 to 01:00
01:00 to 02:00
02:00 to 03:00........etc

Then I want to create another group GH2 within each hour that will actually have the data : {movements.time} which means that if there is no actual data within each group it will just be empty.
Avatar of Ido Millet
Ido Millet
Flag of United States of America image

Create an HOURS table with 24 records showing the start and end time for each hour.
Base your report on that table with a join condition of transaction date is between the start and end time of the HOURS table.
Avatar of John-S Pretorius

ASKER

Ido, great answer - if it wasn't for the fact that I'm not allowed to add tables to the SQL as is that could be a potential option. Is there a way in crystal to do this without having to use the actual .time data that is available as this will leave 'open' hours if there is no data between those Hrs. mcmlc has 'whipped' up something to fill in the empty hours but it becomes a little messy.

Curious how would I create this table in SQL or should I ask this under another post ? I could also use .V....Cut to push to another SQL instance but hope there is an easier way ?
If you are not allowed to create tables, you could create 24 split sections in a dummy main report and insert a subreport in each.  Not an elegant solution, but workable.
Could you elaborate a little on creating 24 split sections please.
Right-click a Crystal Report section (area on the right in Designer).  Insert Section Below...
Thank you, I see your meaning of 'Not-Elegant' - I will see how this pans out.
SOLUTION
Avatar of Ido Millet
Ido Millet
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Mike McCracken
Mike McCracken

It can be handled in 2 subreports.  I have done similar things and can produce a sample if you desire.

mlmcc
Please let me see what you have.
I'll have to build a report tonight to show the method.

Basic idea is the first subreport is inserted in the group header and  displays any "missing" groups based on a shared value.  The second subreport is put in the report footer to get any groups at the end of the day that are missing.

mlmcc
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you.