Click here to Skip to main content
Click here to Skip to main content
Articles » Database » Database » General » Alternatives
 

Tagged as

SQL Get the last date of the month

, 18 Nov 2009 CPOL
declare @Date datetimeset @Date = '2009/10/17'Select dateadd(day, 0 - day(dateadd(month, 1 , @Date)), dateadd(month, 1 , @Date))

Alternatives

Members may post updates or alternatives to this current article in order to show different approaches or add new features.

7 Sep 2009
Mycroft Holmes
2 alternatives  
Select dateadd(day, -1, dateadd(month, 1, dateadd(day, 1 - day(@Date), @Date))

License

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

Share

About the Author

Asif Mushtaq
Software Developer (Senior)
Pakistan Pakistan
No Biography provided

| | Privacy | Terms of Use | Mobile
Web02 | 2.8.141220.1 | Last Updated 18 Nov 2009
Article Copyright 2009 by Asif Mushtaq
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid