Friday, January 6, 2017

How to generate Smart date key from Year, Month and Date

SELECT CONVERT (INT, CONVERT(VARCHAR (8), DATEFROMPARTS([year],[month],[date]),112))
FROM dbo.FactSales;
DATEFROMPARTS (year, month, day)
112 Format = yyyymmdd ISO

No comments:

Post a Comment