afternoon all,
i have the following query:
when i try to run it i receive the following error:
"You tried to execute a query that does not include the specific expression 'IIF([aptrxp].[type]="V",[aptrxp].[inv-num],[aptrxp].[po-num])' as part of an aggregate function."
any suggestions as to what is missing?
thanks in advance.
regards,
longhair
i have the following query:
Code:
SELECT aptrxp.type, aptrxp.voucher, aptrxp.[po-num], IIf([aptrxp].[type]="V",[aptrxp].[po-num],"") AS PO, IIf([aptrxp].[type]="V",[aptrxp].[inv-num],[aptrxp].[po-num]) AS [Inv-Chk], IIf([aptrxp].[type]="V",[vch-hdr].[inv-date]+30,[aptrxp].[dist-date]) AS Due, aptrxp.[dist-date], IIf([aptrxp].[type]="V",[aptrxp].[inv-amt],[aptrxp].[amt-paid]*-1) AS amt, ([vch-hdr].[inv-amt]-Sum([aptrxp].[amt-paid])) AS [Net Due], aptrxp.[amt-paid], aptrxp.[vouch-seq], aptrxp.[check-num], aptrxp.txt, aptrxp.[inv-amt], [vch-hdr].[inv-amt]
FROM [vch-hdr] INNER JOIN aptrxp ON ([vch-hdr].voucher = aptrxp.voucher) AND ([vch-hdr].[vend-num] = aptrxp.[vend-num])
WHERE ((([vch-hdr].voucher)=[pQueryVoucher]))
GROUP BY aptrxp.type, aptrxp.voucher, aptrxp.[po-num], aptrxp.[dist-date], aptrxp.[amt-paid], aptrxp.[vouch-seq], aptrxp.[check-num], aptrxp.txt, aptrxp.[inv-amt], [vch-hdr].[inv-amt]
ORDER BY aptrxp.[vouch-seq];
"You tried to execute a query that does not include the specific expression 'IIF([aptrxp].[type]="V",[aptrxp].[inv-num],[aptrxp].[po-num])' as part of an aggregate function."
any suggestions as to what is missing?
thanks in advance.
regards,
longhair