Tag Archives: code
MS SQL Server Time Dimension UDF
I use this function when writing reports. Use: SELECT time.Date , Count(tab.ID) AS [Count] FROM dbo.TimeDimension(’1/1/2007 00:00:00′, ’12/31/2007 23:59:59′, ‘month’, 1) time LEFT OUTER JOIN TempTable tab ON tab.DateCreated BETWEEN time.Date AND time.DateEnd Here is the function. I don’t know … Continue reading