how to find last day 0f any given month in mysql?

how to find last day of any given month in mysql?

View Answers

December 2, 2010 at 5:00 PM

Hi Friend,

Here is required code:

DECLARE @dtDate DATETIME
SET @dtDate = '8/18/2007'
SELECT DATEADD(s,-1,DATEADD(mm, DATEDIFF(m,0,@dtDate)+1,0))

Thanks


December 22, 2010 at 2:08 PM

hi, SELECT LASTDAY('2003-02-05')FROM tablename

thanks,









Related Tutorials/Questions & Answers:
Advertisements