-4

i am using sql How to get the last day of the month for a given date

01/03/2014 should return 01/31/2014 I only need the date part.. Thanks

1 Answers1

0

For SQL-SERVER, try this:

SELECT convert(varchar,(DATEADD(s,-1,DATEADD(mm, DATEDIFF(m,0,'01/03/2014 ')+1,0))),101)
BWS
  • 3,786
  • 18
  • 25