Posted on 2006-06-22
The table I'm working in has 4 columns that I am worried about: Program, direct, df_date and class.
What I need to do is a sum of direct with a group_by program and df_date where class = 'AC'. Simple enough. However, the values I need to pull for the sum need to be a sum of all items on that date and all previous dates.
So sum(direct at Date1) = sum(direct at Date 1)
sum(direct at Date2) = sum(direct at Date 2) + sum(direct at Date 1)
At any one run of the query it would only be getting data for one Program. So there will probably be another part of the Where - Program = "PID". Right now I'm just trying to see if this is a concept I should try and pursue (sum on the fly) or if I should try and find a different way.
Also, this is going to be part of a coldfusion page, which is why I would like to do it with one query.
Any tips would be very helpful.