With a table of numbers this is quite easy to do.I will provide you with a technical example and I think You can work out the rest.In the example I create a number table with nbrs from 0 - 99, you will likely want a longer one.Also in the code I use the fact that 0 is the first nbr in the number table.SELECT t1.n + t2.n*10 AS nr INTO #tally FROM( SELECT 0 AS n UNION SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4 UNIONSELECT 5 UNION SELECT 6 UNION SELECT 7 UNION SELECT 8 UNION SELECT 9 ) t1CROSS JOIN( SELECT 0 AS n UNION SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4 UNIONSELECT 5 UNION SELECT 6 UNION SELECT 7 UNION SELECT 8 UNION SELECT 9 ) t2ORDER BY 1DECLARE @startdate DATETIME, @enddate DATETIMESELECT @startdate = '9/1/2004', @enddate = '9/3/2004'SELECT CAST( @startdate + t.nr AS DATETIME ) AS MyWorkDateFROM #tally tWHERE t.nr <= DATEDIFF(DAY,@startdate,@enddate)DROP TABLE #tally
rockmoose/* Chaos is the nature of things...Order is a lesser state of chaos */