Select Date Formats Using CONVERT() Function
SELECT date_key
,date
,DAY(date) AS month
,MONTH(date) AS month
,YEAR(date) AS year
,CONVERT(CHAR(4),date,100) + CONVERT(CHAR(4),date,120) AS a
,CONVERT(CHAR(10),date,103) AS b
,CONVERT(CHAR(11),date,113) AS c
,CONVERT(CHAR(10),date,120) AS d
,CONVERT(CHAR(11),date,112) AS e
FROM dim_date
WHERE year = 2012
No comments:
Post a Comment