No, I'm using the Calendar table as a Dimension so I can lump sales etc into "bins" -- summarize by Year/Month whatever.
I was using a dataset someone gave me that was about heart-related symptoms over time. The basic structure of the table was
CREATE TABLE PatientData (
PatientID INT,
SymptomName VARCHAR(20),
SeverityLevel TINYINT,
ConsentDate DATE );
I originally used someone's code from here (Todd Fifield's, I think) that created a Calendar table... I basically did something like this:
DECLARE @MinDate DATE
, @MaxDate DATE
, @DayCount INT;
SELECT @MinDate = MIN(Consent_Date)
, @MaxDate = MAX(Consent_Date);
SET @DayCount = DATEDIFF(day,@MinDate,@MaxDate) + 1;
and then I passed @MinDate and @DayCount to the function that returns a Calendar table. (with Monthname, dayOfWeek, etc...)
I was just trying to see how hard it would be to create a calendar table like that on the fly in M. In a word, PITA. Might be worth it for intellectual exercise, but otherwise, just a hassle. =(