Where CreatedOn = dateadd(day, -1, getdate()) {exclude weekend}

  • Hi all, I have a report with a nested parameter where the WHERE statement incorporates a date selector.

    My question is, how can I make this statement ignore Saturdays and Sundays and jump to the Friday prior?

    EG. I run the report on a monday, I would like the results returned to be Fridays results...

    Thank you!!

    Also, I will eventually want to exclude holidays as well. This site is a great help for me. Thanks again.

    ~ iklektic

  • Please don't cross post. It just wastes peoples time and fragments replies.

    No replies to this thread please. Direct replies to: http://www.sqlservercentral.com/Forums/Topic939716-149-1.aspx

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Thank you Gail, my apologies.

    Is there a way to delete a post that was placed incorrectly? I tried to find one, but couldn't.

    ~iklektic

  • No. Threads can't be deleted.

    If you post in the wrong place, you can either report the post and request that it be moved, or post a new thread and update the old one to point to the new.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 4 posts - 1 through 3 (of 3 total)

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