how to get Number of days of current Month in sql server?
how to get Number of days of current Month in sql server?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Abhay ShankerPosted Apr 21, 2014, 1:16 AM
set @dt = getdate()
select
DT = @dt,
[Days in Month] =day(dateadd(mm,datediff(mm,-1,@dt),-1))
Ankur JainPosted Apr 21, 2014, 12:50 AM