CREATE FUNCTION dbo.fn_IsLeapYear (@year int)
RETURNS BIT
as
BEGIN
RETURN(SELECT CASE DATEPART(MM, DATEADD(DD, 1, CAST((CAST(@YEAR AS VARCHAR(4)) + '0228') AS DATETIME)))
WHEN 2 THEN 1
ELSE 0
END)
END
GO
Happy Learning........
RETURNS BIT
as
BEGIN
RETURN(SELECT CASE DATEPART(MM, DATEADD(DD, 1, CAST((CAST(@YEAR AS VARCHAR(4)) + '0228') AS DATETIME)))
WHEN 2 THEN 1
ELSE 0
END)
END
GO
Happy Learning........
No comments:
Post a Comment