Count() with expressions, vs. numerics

  • I have a report that needs to increment internal numeric parameters based on the contents of a non-numeric field, then display those parameters in the group footer, and reset them the zeros. Can someone point me in the right direction?

  • I'm not clear on what you're asking for. Can you expand on it?

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • Let's say I have a group. Within that group I have a VARCHAR column that will contain either "foo" or "bar". I have 2-hidden parameters; "TotalFoos" and "TotalBars". The default non-queried values for these parameters is zero. As each row within the group is printed, I need to increment either the "TotalFoos" or "TotalBars" parameter based upon what's in the VARCHAR column. Then, in the group footer display;

    "Total Foos: " & =Parameters!TotalFoos.Value.ToString()

    "Total Bars: " & =Parameters!TotalBars.Value.ToString()

    After the group footer is printed, reset the parameters to zero for the next group.

    Thanks for your quick reponse!

  • Look up Jeff Moden's article on Running Totals (on this site). Should be able to use that for what you need.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • GSquared (2/2/2009)


    Look up Jeff Moden's article on Running Totals (on this site). Should be able to use that for what you need.

    The article is temporarily "offline" until I can finish the rewrite. Ironically, the ORDER BY update is the one that no longer works as of 2k5 (I wrote the article against 2k before I upgraded to 2k5).

    --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 5 posts - 1 through 4 (of 4 total)

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