Results 1 to 3 of 3

Thread: Rolling Total

  1. #1
    Join Date
    Apr 2006
    Posts
    2

    Unanswered: Rolling Total

    I am trying to run a 12 month rolling total in access with this line of code.

    I have a query that pulls the data that I want out and filters and sums it to fit my date range. "02c-02 Sum individual HAPS"

    The fields in this query are:
    TIME_FROM (GROUP BY)
    POLLUTANT_CAT_CD (GROUP BY)
    EMISSION_LBS (SUM)

    I am trying to run my next query "02c-03 Rolling HAP Sum" with the following fields:
    POLLUTANT_CAT_CD
    TIME_FROM
    SumOfSumOfEMISSION_LBS

    the last field is:
    Rolling_Total: DSum("[Rolling_Total]","[02c-02 Sum individual HAPS]","[TIME_FROM]Between #" & [TIME_FROM] & "# And DateAdd(""D"", -366, #" & [TIME_FROM] & "#)")

    I don't get any error messages, but I don't get any results either.

    Any help would be GREATLY appreciated. It does not have to use the above code, anymethod will be fine w/me.

    Thanks,

    Will R

  2. #2
    Join Date
    Jul 2004
    Location
    Southampton, UK
    Posts
    368
    Hi Will

    When you say you don't get any results do you mean that no records are returned or do you mean that your Rolling_Total is blank ?

    Your DSUM is based on summing the Rolling_Total column. But if this column has no data (is all zero) in it then summing will still produce zeros. Moreover, you don't mention that Rolling_Total is even included in the "02c-02 Sum individual HAPS" query. Did you really mean to use SumOfEMISSION_LBS in your DSUM?

    Chris

  3. #3
    Join Date
    Apr 2006
    Posts
    2

    Oh, crap......

    Ya know when sometimes you work so long on something so minor that you miss something really obvious....

    Then somebody (you) sees it.....

    Next time you're in the states, i owe you a beer or 12!!

    Thanks!!!

    Will

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •