Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Show Zero Values

Status
Not open for further replies.

ProgressiveJL

IS-IT--Management
Jul 5, 2006
46
CA
Hi All,

I'm creating a report in CR XI that displays customer activity by the hour. My current report groups by MID(string) of a time field. The problem that I have is that hours are only displayed when there is activity for a particular hour, but, what I want is to list all hours and then show a 0 value for hours with no activity.

Any suggestions?
 
If you can change the database, add a table which has the hours and then do a left-outer link from it to your data.

Failing that, you probably need to do a 'Mock Crosstab', with separate Running Totals for each possibly hour. Tedious but it works.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
I'm not very familiar with cross-tabs but I think I've done it correctly and unfortunately, the results are the same.

I've tried 2 methods of grouping my data using IF-Then-Else and Case controls.

------
select {@hour} \\where time is stored as HH:MM:SS
case 00 : "12 AM - 1 AM"
case 01 : "1 AM - 2 AM"...
------
if {TranClosed01.TTIME} > "00000000" and {TranClosed01.TTIME} < "01000000" then "12 AM - 1 AM"
else
if {TranClosed01.TTIME} > "01000000" and {TranClosed01.TTIME} < "02000000" then "1 AM - 2 AM"
else
------

I need my table and chart to display a zero value for hours that don't have any records.

Looking forward to any suggestions!
Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top