Cummulative Totals By Dynamic Month Range

  • Jeff:

    I don't believe the 8k limit and SQL2 is the problem as in either scenario (starting at 10/01/2005 or 09/01/2005) no data exists for either of these months. In other words, the same transactions will be returned from the source tblTestNetworth regardless of which of these start dates are selected. The procedure would simply be providing "$0.00's" for the columns in both cases. My entire dataset only contains about 2000 transactions at this point.

    Any other thoughts which might be causing the error?

  • Step one would be to prove my conjecture on the problem wrong... print out the dynamic SQL using PRINT @SQL1+@SQL2+@SQL3 and copy the results (will be SQL) to another query window and run it. I believe you'll see the problem immediately and I beleive you'll find I'm correct in my conjecture.

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

  • Yes, I shouldn't have doubted you. I'll have to re-think the approach to this procedure as I was not aware of the 8k restriction.

    Thanks for your response and help.

Viewing 3 posts - 31 through 33 (of 33 total)

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