I am using Access and trying to modify this query:
SELECT
DateDiff("d", [Invoice]![TxnDate],[ReceivePaymentLine]![TxnDate]) AS ActualPaymentDays,
IIF ([ActualPaymentDays] < 90, 0.10, IIF ([ActualPaymentDays] < 120, 0.09, IID ([ActualPaymentDays] , 365, 0.05, 0))) AS PayPerValue
FROM
ReceivePaymentLine
INNER JOIN
Invoice ON ReceivePaymentLine.AppliedToTxnTxnID = Invoice.TxnID
I make the table "ActualPaymentDaysRate":
ActualPaymentDay1
PayPerValue1
ActualPaymentDay2
PayPerValue2
ActualPaymentDay3
PayPerValue3
And I modify the request above to be this request:
SELECT
DateDiff("d",[Invoice]![TxnDate],[ReceivePaymentLine]![TxnDate]) AS ActualPaymentDays,
IIF ([ActualPaymentDays] < [ActualPaymentDaysRate.ActualPaymentDay1],[ActualPaymentDaysRate.PayPerValue1], IIF ([ActualPaymentDays] < [ActualPaymentDaysRate.ActualPaymentDay2], [ActualPaymentDaysRate.PayPerValue2], IIF ([ActualPaymentDays] < [ActualPaymentDaysRate.ActualPaymentDay3],[ActualPaymentDaysRate.PayPerValue3], 0))) AS PayPerValue
FROM
ActualPaymentDaysRate, ReceivePaymentLine
INNER JOIN
Invoice ON ReceivePaymentLine.AppliedToTxnTxnID = Invoice.TxnID
It shows the error "JOIN expression is not supported."
source
share