• Digs (1/6/2013)


    First the code...

    ....

    The result from the 1st SELECT is this:

    201302201253201252201251

    As you can see I am missing 201301

    QUESTION: how can I fix this? I need YYYYMM in order.

    PS: I dont have a Calender table with YYYYMM, unles you know where I can get one ?

    Any ideas

    You ask for a date in format YYYYMM but your query generate the date in strange format YYYYWW where WW mean week number.

    Your query will return values that you are expecting day after tomorrow 🙂

    Today we have 06 january 2013 if you substract 7 days, then we have?