I am creating a reliable date table to find out how best to contact it. The primary key cluster index will be included in the smart-date integer key key (according to the Kimball specification) with the name DateID. So far, I have been performing queries against it like this:
select Foo.orderdate
,DTE.FiscalYearName
,DTE.FiscalPeriod
,DTE.FiscalYearPeriod
,DTE.FiscalYearWeekName
,DTE.FiscalWeekName
FROM SomeTable Foo
INNER JOIN
DateDatabase.dbo.MyDateTable DTE
ON DTE.date = CAST(FLOOR(CAST(Foo.forderdate AS FLOAT)) AS DATETIME)
Keep in mind that Date is a nonclustered index field with values such as: 2000-01-01 00: 00: 00.000
It just seemed to me that since I have a clustered integer index (DATEID), maybe I should convert the date and time into my database field so that it matches it and is associated with this field.
What do you think?
, , , ? ?