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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Showing every day even when there is no data

Status
Not open for further replies.

Stoffel24

Technical User
Apr 4, 2002
121
0
0
ZA
Hi. I would like to group by the day of the month such that EVERY day of the month is shown regardless of whether there is data for this day or not.

Firstly, this report is run for a whole month only. (ie only Jan or only Feb etc) I have data reported for samples that are logged in on certain days. On some days, no sample is logged. Therefore, if I group on logged_date, I get gaps in my days. What I would like is for there to be no gaps in the days and when no sample was logged, for there to be no results reported. I have thought about doing the report using a formula returning 1 to 31 for Jan, March, May etc and 1 to 30 for April, June etc and then there's pesky February which I don't even want to start thinking about (Stupid Romans!) But I am not sure this is very elegant nor am I sure how to go about doing this even if I wanted to! How would this formula work? But perhaps there are some among you who have much better ideas...I hope!

Any help would be appreciated!
 
There are a few approaches from within Crystal, but your best long term solution is to borrow from data warehousing and use a Periods table, which would contain every day of every year, and you can add value by adding things like Holidays, Weekends, Fiscal periods, etc.

Now select dates from the periods table and left outer to your data.

-k

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top