Number of days in month : Sql server(sanjevsharma.blogspot.com)
submitted by
sanjev.sharma(579) 3 years, 10 months ago
declare @month int, @year int, @date datetime
select @month = 2, @year = 2000
select @date = convert(varchar, @year) + right('0' + convert(varchar, @month), 2) + '01'
select datediff(d, @date, dateadd(m, 1, @date)) as "Number of Days"
-- This one determines the last day of the month.
-- Uses almost similar logic as the above statement.
select dateadd( d, -1 , dateadd( m , 1 , @date ) ) AS "Last Day Of Month"
|category: ASP.NET
|Views: 7
tags:
ASP.NET another
Everyones tags:
Your Tags: