WARDY IT Solutions Blog

A blog on Brisbane's leading SQL Server consulting and training company

Date for Monday and Friday of Current Week

The Date for Monday and Friday of the current week can be determined as illustrated below.

SELECT GETDATE() + (2 - DATEPART(WEEKDAY, GETDATE())) AS MONDAY, GETDATE() + (6 - DATEPART(WEEKDAY, GETDATE())) AS FRIDAY

This assumes that you consider the first day of the week to be a Sunday and that the last day of the week is a Saturday.  If this is not the case you will need to use the SET DATEFIRST to set the first day of the week to a number from 1 through 7.  ie. SET DATEFIRST 1 to set MONDAY.  To determine the day that is currently set as the first day of the week run SELECT @@DATEFIRST (by default this is 7 which is Sunday).

 
Published Wednesday, November 02, 2005 1:25 PM by peter@wardyit.com

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Leave a Comment

(required) 
(optional)
(required) 
Submit