• farrukhhameed786 (8/23/2013)


    Hello all,

    I need two sample sqlserver queries

    1. query get the data 1st date of the month to calendar week like week 1 , week 2 , week 3 etc.

    2. Second I need a query example the query runs always before Thursday get the previous sum of week data but end date always Thursday?

    Thanks

    fkh

    Since you're talking about Thursday, what day of the week does a week start on for you? Also, if a month doesn't start on the same day as the first day of the week and the fact the the first "week" of any given month could be as small a single day, what days of the week do you want to show for the first and last weeks of the month?

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)