PaulRobertson14
Tuesday, 9 April 2013
List of Month Names Using CTE
WITH
CTEMonth
AS
(
SELECT
1 AS month_number
UNION
ALL
SELECT
month_number + 1
FROM
CTEMonth
WHERE
month_number <= 11
)
SELECT
month_number,DATENAME(MONTH, DATEADD(MONTH, month_number, 0) - 1) [month_name]
FROM
CTEMonth
No comments:
Post a Comment
Newer Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment