When I run the below code it thinks there are 29 days in Feb, how do I check for leap year.
MyDate between (DateAdd(day,1,EOMONTH(Getdate(),-1))) AND GETDATE()
When I run the below code it thinks there are 29 days in Feb, how do I check for leap year.
MyDate between (DateAdd(day,1,EOMONTH(Getdate(),-1))) AND GETDATE()
Use below query to check leap year :
DECLARE @YEAR INT = 2019
SELECT CASE WHEN (@YEAR % 4 = 0 AND @YEAR % 100 <> 0) OR @YEAR % 400 = 0 THEN
'LEAP YEAR' ELSE 'NORMAL YEAR' END