Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 

Get your favourite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved in your SSC briefcase from the favorites tab.
Download now (direct download link)

Finding first/last day of month by a date

By Benny.Tordrup,

This script finds the first day of previous, current and next month as well as last day of previous, current and next month.

The calculation is based on the ISO date format which makes it independant of the date format used on the SQL Server.

The calculation is performed from a date - it can be altered to use a year/month combination

Total article views: 191 | Views in the last 30 days: 1
 
Related Articles
SCRIPT

Month Name

Function to return the Month Name for month number input

FORUM

convert month name to month number

convert month name to month number

FORUM

Month/Year

Month/Year format through TSQL

SCRIPT

Financial Month

This Script will return the respective financial month(Starts from April to March) for a calander mo...

FORUM

Display Month wise data

Dynamic month column

Tags
miscellaneous    
 
Contribute

Join the most active online SQL Server Community

SQL knowledge, delivered daily, free:

Email address:  

You make SSC a better place

As a member of SQLServerCentral, you get free access to loads of fresh content: thousands of articles and SQL scripts, a library of free eBooks, a weekly database news roundup, a great Q & A platform… And it’s our huge, buzzing community of SQL Server Professionals that makes it such a success.

Join us!

Steve Jones
Editor, SQLServerCentral.com

Already a member? Jump in:

Email address:   Password:   Remember me: Forgotten your password?
Steve Jones