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
 SQL Server Development (2000)
 Date overview with holes

Author  Topic 

bjornh
Yak Posting Veteran

87 Posts

Posted - 2002-10-12 : 10:39:19
hi,

I've got a table with data that looks like this:

date | pageviews
---------------------------------------
17-8-2002 | 204
18-8-2002 | 34
20-8-2002 | 54
21-8-2002 | 78
23-8-2002 | 100
---------------------------------------

As you can see, there are some dates missing. No not really missing, but on those dates there was not a hit (pageview) on the server.
Now, I would like to create a output like this:

date | pageviews
---------------------------------------
17-8-2002 | 204
18-8-2002 | 34
19-8-2002 | 0
20-8-2002 | 54
21-8-2002 | 78
12-8-2002 | 0
23-8-2002 | 100
---------------------------------------

so with the dates that where missing added on the right position.
What is the best way to approach this problem?

Thanks

Bjorn Huijbregts



Edited by - bjornH on 10/12/2002 10:41:56

robvolk
Most Valuable Yak

15732 Posts

Posted - 2002-10-12 : 11:08:05
http://www.sqlteam.com/item.asp?ItemID=3332

Go to Top of Page

bjornh
Yak Posting Veteran

87 Posts

Posted - 2002-10-12 : 11:22:04
Ow sorry, I missed that one. Thanx

Go to Top of Page
   

- Advertisement -