shabla Habeeb
how to find last day 0f any given month in mysql?
2 Answer(s)      4 years and 9 months ago
Posted in : SQL

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

Advertisement
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,