G
Gary B
Table: Payments
PaymentsKey, Amount
967, $50.00
Table: Applied
PaymentsKey, AppliedAmount
967, $22.00
967, $13.00
967, $05.00
This will return TotalAmountApplied:
SELECT PaymentsKey, Sum(Applied.AppliedAmount) AS SumOfAppliedAmount
FROM Payments INNER JOIN Applied ON Payments.PaymentsKey =
Applied.PaymentsKey
WHERE (((Payments.PaymentsKey)=667))
GROUP BY Payments.PaymentsKey
But, How do I return the Amount UNAPPLIED or from the above example, $10.00
Thank you
PaymentsKey, Amount
967, $50.00
Table: Applied
PaymentsKey, AppliedAmount
967, $22.00
967, $13.00
967, $05.00
This will return TotalAmountApplied:
SELECT PaymentsKey, Sum(Applied.AppliedAmount) AS SumOfAppliedAmount
FROM Payments INNER JOIN Applied ON Payments.PaymentsKey =
Applied.PaymentsKey
WHERE (((Payments.PaymentsKey)=667))
GROUP BY Payments.PaymentsKey
But, How do I return the Amount UNAPPLIED or from the above example, $10.00
Thank you