Start and End Date of specific date.

Declare @Date datetime, @Start Datetime, @End Datetime

SET @Date = '02/17/2011' ------- Your Date

SET @Start = DATEADD(dd, 1, DATEADD(dd, -DATEPART(dd, @Date), @Date))
SET @End = DATEADD(dd, -1, DATEADD(mm, 1, @Start))

SELECT @Start AS [Start Date], @End  AS [End Date]

Comments

Popular posts from this blog

Run a VBscript using SQL Server.

Practical Web Scraping with Python: A Clean, Safe Pattern for Pulling Company Names & Emails

Don't send that empty SSRS report.