MikeAuz1979
Programmer
Hi,
I'm using Access 2000 query and I have a culmlative counter that converts daily amounts to a running total. This works fine but I don't want the counter to start until a certain date. (A Contract Start date) The end result of this query is a chart that shows Culmlative consumption and ACQ between the Contract Start and End dates.
Below I have the query that works for straight forward counter but I don't want the culmlative counter to start until the Date [QryCGBConsMDQACQ.RateFrom] (The RateFrom and RateTo are the same date for every record. For example in the case of MIRN 1000 RateFrom is 01/03/2006 and RateTo is 31/05/2007)
FYI this query is actually part of an append query so please don't be concerned about the lack of proper alias
----Query Start---
SELECT QryCGBConsMDQACQ.MIRN AS Expr1, QryCGBConsMDQACQ.GasDate AS Expr2, QryCGBConsMDQACQ.DailyGJ AS Expr3, (Select Sum(DailyGJ) from QryCGBConsMDQACQ t1 where t1.GasDate <= t0.GasDate Group By MIRN) AS CulmCounter, QryCGBConsMDQACQ.CustName AS Expr4, QryCGBConsMDQACQ.MDQGJ AS Expr5, QryCGBConsMDQACQ.ContractAnnQtyGJ AS Expr6, QryCGBConsMDQACQ.RateFrom AS Expr7, QryCGBConsMDQACQ.RateTo AS Expr8
FROM QryCGBConsMDQACQ AS t0;
----Query End---
Thanks for any help
I'm using Access 2000 query and I have a culmlative counter that converts daily amounts to a running total. This works fine but I don't want the counter to start until a certain date. (A Contract Start date) The end result of this query is a chart that shows Culmlative consumption and ACQ between the Contract Start and End dates.
Below I have the query that works for straight forward counter but I don't want the culmlative counter to start until the Date [QryCGBConsMDQACQ.RateFrom] (The RateFrom and RateTo are the same date for every record. For example in the case of MIRN 1000 RateFrom is 01/03/2006 and RateTo is 31/05/2007)
FYI this query is actually part of an append query so please don't be concerned about the lack of proper alias
----Query Start---
SELECT QryCGBConsMDQACQ.MIRN AS Expr1, QryCGBConsMDQACQ.GasDate AS Expr2, QryCGBConsMDQACQ.DailyGJ AS Expr3, (Select Sum(DailyGJ) from QryCGBConsMDQACQ t1 where t1.GasDate <= t0.GasDate Group By MIRN) AS CulmCounter, QryCGBConsMDQACQ.CustName AS Expr4, QryCGBConsMDQACQ.MDQGJ AS Expr5, QryCGBConsMDQACQ.ContractAnnQtyGJ AS Expr6, QryCGBConsMDQACQ.RateFrom AS Expr7, QryCGBConsMDQACQ.RateTo AS Expr8
FROM QryCGBConsMDQACQ AS t0;
----Query End---
Thanks for any help