Thursday, 27 June 2013

Query to determine end of month

DECLARE @Dt DATETIME

SET @Dt = '2013-02-28'

IF MONTH(@Dt) != MONTH(DATEADD(DAY,1,@Dt))
BEGIN
PRINT 'End Of Month'
END
else
begin
print 'Middle of Month'
end

No comments:

Post a Comment