Find last business day from table with date and day in SQL 2008 and 2012

  • Hi All,

    I need last business day from a table with ID,date and day column in it in SQL server 2008 and 2012.

    For e.g.

    ID Date Day

    1 1-Jan-2016 Friday

    2 2-Jan-2016 Saturday

    3 3-Jan-2016 Sunday

    .

    .

    29 29-Jan-2016 Friday

    30 30-Jan-2016 Saturday

    31 31-Jan-2016 Sunday

    32 1-Feb-2016 Monday

    33 2-Feb-2016 Tuesday

    .

    .

    60 29-Feb-2016 Monday

    and so on....

    so I need

    29-Jan-2016 Friday(Excluding Saturday and Sunday)

    29-Feb-2016 Monday

    .

    .

    .

    Thanks

    Praful

  • duplicate post.

    no need to cross post to multiple forums it fractures the answers you get and makes posters duplicate others work.

    the "Recent Posts" link shows us everything.

    continue the thread here:

    http://www.sqlservercentral.com/Forums/Topic1838607-360-1.aspx

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

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

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