ALTER FUNCTION [dbo].[GetMonthNo]
(
@MonthName NVARCHAR(50)
)
RETURNS NVARCHAR(MAX)
AS
BEGIN
RETURN(CASE @MonthName
WHEN 'january' THEN 1
WHEN 'february' THEN 2
WHEN 'march' THEN 3
WHEN 'april' THEN 4
WHEN 'may' THEN 5
WHEN 'june' THEN 6
WHEN 'july' THEN 7
WHEN 'august' THEN 8
WHEN 'september' THEN 9
WHEN 'october' THEN 10
WHEN 'november' THEN 11
WHEN 'december' THEN 12
ELSE '' END)
END
No comments:
Post a Comment