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)
 Adding records into result returned by Select

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2000-11-11 : 12:11:21
Craig writes "I want my query to display some statistics for the past 30 days, and I want the query to contain exactly 30 records. The problem is that on some days there are no statistics in my table so the query will return no record for that date. I would like it to return the date with the statistics set to zero, so that I will always end up with 30 records.

I could do this by creating a table with all dates and doing a UNION with my table for the dates of interest but I wanted to know if there was a programatic way of doing this."
   

- Advertisement -