Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts 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: 201 | Views in the last 30 days: 3
 
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