Click here to Skip to main content
15,881,757 members
Articles / Database Development / SQL Server
Tip/Trick

Get days of a month in SQL

Rate me:
Please Sign up or sign in to vote.
2.00/5 (1 vote)
3 Feb 2010CPOL 8.3K   1   2
select days_of_month=day(dateadd(mm,-1,'12-feb-2010'),-1) :laugh:
SQL
select days_of_month=day(dateadd(mm,-1,'12-feb-2010'),-1)
:laugh:

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Junior) LUCID INFOTECH
India India
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
QuestionWhat is that? Pin
PeterMoon23-Jan-10 9:05
PeterMoon23-Jan-10 9:05 
QuestionElaborate? Pin
AspDotNetDev23-Jan-10 4:14
protectorAspDotNetDev23-Jan-10 4:14 
Care to elaborate?


General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.