I have another question, does any one know how to get the start date and end date of the current week?
Thanks very much.
Ling
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
DATEPART(dw, GETDATE())will return the current day of week as an integer (Sunday=1, Saturday=7)Simple math will take care of the rest.
DATEADD(dd, 7 - DATEPART(dw, GETDATE()), GETDATE())DATEADD(dd, -1 * DATEPART(dw, GETDATE()), GETDATE())