Friday, September 18, 2009

How to Get Noof Days in the month

Here I provide T-SQl Statement to get no of days in month using SQl server 2005

DECLARE @Dates datetime,@DaysInMonth int
set @dates='02/01/2009'
SET @DaysInMonth=Day(DateAdd (Month,1,@dates)-Day(DateAdd(Month,1,@dates)))
select @DaysInMonth









Tamilish






No comments:

Post a Comment