Thursday, February 1, 2007

Previous week startdate and enddate in SQL Server 2005,SQL Server 2000

s have found the way to get start date and end date of previous week with the help of the date part function of SQL Server 2005. It also work on sql server 2000 also.

Following are the code for finding start date and end date of previous week.

Set @STimeStamp=GETDATE()
set @[email protected](dw,@STimeStamp)-6
set @[email protected](dw,@STimeStamp
)


Happy Programming
Share:

3 comments:

  1. This is awesome code. Thanks a ton for the post.

    ReplyDelete
  2. This code is very helpful. Keep up the good work.

    ReplyDelete
  3. this code is really helpful, thanks a lot

    ReplyDelete

Your feedback is very important to me. Please provide your feedback via putting comments.

Search This Blog
About Me
My Photo

Full Stack Developer, Blogger, Microsoft Mvp, Mentor, Lifelong learner, 12+ Years of Experience for JavaScript, web and Microsoft technologies. ASP.NET MVC/Core, C#, Angular,Vue.js and node.js
Subscribe to my blog

  

My You tube channel- Please Subscribe
Youtube Video Playlist
My Mvp Profile
Follow us on facebook
Blog Archive
Total Pageviews