September 2, 2015 at 10:48 am
Can someone advise me to get date for 8/17 (Monday ) and 8/23 (Sunday) which is a week before the last.
September 2, 2015 at 11:02 am
sharonsql2013 (9/2/2015)
Can someone advise me to get date for 8/17 (Monday ) and 8/23 (Sunday) which is a week before the last.
Based on what?
September 2, 2015 at 11:06 am
Taking a guess I would say this:
declare @CurDate date = getdate();
select
dateadd(week, datediff(week, 0, @CurDate) - 2, 0),
dateadd(day, 6, dateadd(week, datediff(week, 0, @CurDate) - 2, 0))
September 2, 2015 at 11:22 am
That helps. Thanks
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply