Generating Dates

  • There is probably a better way to do it but this seems to work.

    SELECT di.Item, di.d_Date, #Values.Value

    FROM (select distinct d_date,item from #Dates ,#Values ) di LEFT OUTER JOIN #Values ON di.d_Date = #Values.SaleDate and #values.item=di.item


  • That nice little cross-join you included as a derived table sure did the trick.

    --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)

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

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