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

Displaying all dates in a range

Status
Not open for further replies.

doub123

Programmer
Jun 19, 2002
11
MT
I have a table which contains events that occur on a certain date. I would like to display ALL days of the last week and a count of the number of events that occured on each day. The problem is that if no events occur on a certain day, then the report does not display it (i.e 0 is not displayed). Does anyone know a workaround for this problem, so that all days incuding those with a 0 count are displayed.

I saw another post that suggested a new table which contains all the dates of the year, but this is not very ideal.


Thanks
 
Base the report on a stored procedure instead.
Then let the SP do the work creating all the days. Andrew Baines
Chase International
 
You can create an array(s) to hold 7 values, then just fabricate the dates based on currentdate-X.

You won't be able to group on these non-existent dates, but you can create 7 subtotals/totals, etc.

-k

kai@informeddatadecisions.com
 
Synapsevampire -

I didn't exactly understand how to do this. I tried using arrays, but I did not manage anything productive. Can you help me out a bit more please.

Thanks

Drew


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top