The SQL of the query should look something like the following.
SELECT Paid.Month
, (SELECT Sum({Balance Of Account])
FROM Balance
WHERE Balance.Month <= Paid.Month) as RunningBalance
, (SELECT Sum({Balance Of Account])
FROM Balance
WHERE Balance.Month <= Paid.Month) / Paid.[Sum of Paid] as Calculation
FROM Paid
--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
nazzoli said:
I need help building an expression within a query or report.
I have 2 queries I am utilizing to create a new query.
The first query (Paid) houses this information:
Month Sum of Paid
1 100
2 450
3 700
.
.
12 200
Months are from 1-12.
The second query (Balance) houses this information
Month Balance of Account
1 1000
2 1000
3 5000
.
.
12 1000
Months are from 1-12.
I am looking to create a new query utilizing the above queries to create
an
expression that will do the following by month
Month Percent
1 month1 balance/month 1 paid
2 sum of month1 and 2 balance/month 2 paid
3 sum of month 1,2 and 3 balance/month 3 paid
.
.
12 sum of months 1-12 balance/month 12 paid
Any help would be appreciated.