Solved

Creating 24 * 1 Hr Groups based on a normal Day

Posted on 2013-05-15
12
187 Views
Last Modified: 2013-05-20
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.
0
Comment
Question by:John-S Pretorius
  • 5
  • 4
  • 3
12 Comments
 
LVL 22

Expert Comment

by:Ido Millet
ID: 39169362
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.
0
 

Author Comment

by:John-S Pretorius
ID: 39169415
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 ?
0
 
LVL 22

Expert Comment

by:Ido Millet
ID: 39169436
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.
0
 

Author Comment

by:John-S Pretorius
ID: 39169452
Could you elaborate a little on creating 24 split sections please.
0
 
LVL 22

Expert Comment

by:Ido Millet
ID: 39169461
Right-click a Crystal Report section (area on the right in Designer).  Insert Section Below...
0
 

Author Comment

by:John-S Pretorius
ID: 39169478
Thank you, I see your meaning of 'Not-Elegant' - I will see how this pans out.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 22

Assisted Solution

by:Ido Millet
Ido Millet earned 150 total points
ID: 39169510
A cleaner solution is to create an HOURS table in Excel or Access.
Create a main report based on that table. Insert the subreport in the Detail section, and pass the start & end time values as subreport links.

This avoids the need to create 24 subreports...  :o)
0
 
LVL 100

Expert Comment

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

mlmcc
0
 

Author Comment

by:John-S Pretorius
ID: 39169576
Please let me see what you have.
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 39169593
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
0
 
LVL 100

Accepted Solution

by:
mlmcc earned 250 total points
ID: 39170244
Actually I didn't need a subreport.

mlmcc
Q-28129183-IncludeMissingGroup.rpt
Q-28129183.xls
0
 

Author Closing Comment

by:John-S Pretorius
ID: 39180813
Thank you.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Crystal Reports Groups need Hand Cursor on Hover 4 71
Crystal Reports - group header 2 40
Crystal Reports get subgroup count 1 47
business objects to connect to MSSQL 6 63
Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now