Group by calendar/business week?

  • I've been tasked with writing a report showing our weekly earnings. Unfortunately datepart(wk, @refdate) is the week since jan-01 which in this case was a thursday. My boss wants to know Sun-Sat or Mon-Sun. How can I do this?

  • Instead of using the datepart function you might want to play around with "select dateadd(wk, datediff(wk, 0, @ThisDate), 0)". This will give you the date of Monday from @ThisDate.

    Please note that it will show the following Monday if the date refers to a Sunday.



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply