1 Reply Latest reply on Feb 16, 2010 2:28 PM by philmodjunk

    Running total for a single point in time

    k1ngf1sher

      Title

      Running total for a single point in time

      Post

      Hi all, In my database, I have a table with Sites, Site Operations, and Site Operation Log.  A Site can have multiple Operations and an Operation can have multiple Log events.  For each Operation, there is a livestock Type and Phase.  I populate the Operation Log table with a starting herd size (e.g., 1000) and Phase (e.g., Nursery) and then each time the herd size changes, I add another record to the Operation Log and detail the change in herd size.  What I'm interested in doing is keeping a running total of herd size through time, which I was considering calling 'CurrentTotal'.  I attempted to solve this problem with a self-join with a 'Sum' function, but the 'CurrentTotal' only shows the total at this very moment, not the total as it changed with each new record in the Operation Log.  How I can do this as a calculation in my table?

       

      Thanks for your attention.

      K