G
Guest
Table is as follows:
LoanID | PayAmt | PayDate
1 | 100. | 1/1/2005
1 | 100. | 2/1/2005
1 | 100. | 3/1/2005
2 | 100. | 1/1/2005
2 | 100. | 1/16/2005
2 | 100. | 2/1/2005
2 | 100. | 2/16/2005
Is it possible to write a query that will return the sum of the payamt as
well as the sum of the payamt for payments that are dated before today? (or
just the difference between the two)
result:
LoanID | SumAll | SumPast | (Diff)
1 | 300. | 200. | 100.
2 | 400. | 300. | 100.
Thanks in advance,
Brad
LoanID | PayAmt | PayDate
1 | 100. | 1/1/2005
1 | 100. | 2/1/2005
1 | 100. | 3/1/2005
2 | 100. | 1/1/2005
2 | 100. | 1/16/2005
2 | 100. | 2/1/2005
2 | 100. | 2/16/2005
Is it possible to write a query that will return the sum of the payamt as
well as the sum of the payamt for payments that are dated before today? (or
just the difference between the two)
result:
LoanID | SumAll | SumPast | (Diff)
1 | 300. | 200. | 100.
2 | 400. | 300. | 100.
Thanks in advance,
Brad