Year calendar 2004
This high perfomance query returns year calendar in a table format:
select top 366 * from ( select convert(smalldatetime, '20040101') + n3.num * 100 + n2.num * 10 + n1.num as CalendarDate from ( select 0 as num union all select 1 union all select 2 union all select 3 union all select 4 union all select 5 union all select 6 union all select 7 union all select 8 union all select 9 ) n1, ( select 0 as num union all select 1 union all select 2 union all select 3 union all select 4 union all select 5 union all select 6 union all select 7 union all select 8 union all select 9 ) n2, ( select 0 as num union all select 1 union all select 2 union all select 3 ) n3 ) gencalendar order by 1
Saturday, March 13, 2004 8:24 AM