Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 doing a date join to create blank values for no-data dates

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-01-18 : 10:41:01
Rhys writes "I want to create a graph of hits per day from a query like this:

select hit_date, count(hit_date) from vloginstats group by hit_date

where hit_date is a date with the time always 12pm. This returns the count for each day that has data, but nothing for days which have none. Is it possible to create a query of days within a date range and join that to my data so that I get a result set which has a value for every day within the range (null for days where there was nothing)?"

robvolk
Most Valuable Yak

15732 Posts

Posted - 2002-01-18 : 11:55:54
Take a look at this:

http://www.sqlteam.com/item.asp?ItemID=3332

Go to Top of Page
   

- Advertisement -