I get the following error when trying to run a report: Multi-level
GROUP BY clause is not allowed in a subquery. (Error 3612)
The report's recordsource is a query based on a single table. However,
one of the fields in the query is a subquery. This field is also used
in the calculations for a few other fields in the query.
I'm able to run the report with no group levels. But the addition of
even one group level causes the error.
Any help would be greatly appreciated. The query's SQL can be found
below...
SELECT PaymentID, OfferingID, Date, PeriodStart, PeriodEnd, Payment,
(SELECT -Sum([tblPayments1.Payment]) AS NetInvCap
FROM tblPayments AS P1
WHERE P1.OfferingID = OfferingID AND P1.Date < Date AND
(P1.PaymentTypeID = 4 OR P1.PaymentTypeID = 6)) AS NetInvCap,
IIf(Nz([NetInvCap])>0,[Payment]/[NetInvCap],0) AS Return,
[PeriodEnd]-[PeriodStart]+1 AS Days,
(360/IIf([Days]>360,360,[Days]))*[Return] AS APR
FROM tblPayments;