I'm trying to execute a sql string, containing two IIF function calls, against a Jet table and cannot figure out the correct syntax.
The string built with the QBE frame is as follows:
SELECT tbTest.ClientID, tbTest.sClient AS Client,
IIf([fBillSeparately],[sFile],"") AS File,
tbTest.fBillSeparately AS [Group]
FROM tbTest
GROUP BY tbTest.ClientID, tbTest.sClient,
IIf([fBillSeparately],[sFile],""),
tbTest.fBillSeparately
ORDER BY tbTest.fBillSeparately;
The two IFF function calls, when the string is executed in VBA, are the problem.
Attached is a simple Access 2002 zipped database illustrating how I'm using the string. See Form1.
Hopefully someone can help me with the syntax.
Thank you in advance for your time and trouble.
The string built with the QBE frame is as follows:
SELECT tbTest.ClientID, tbTest.sClient AS Client,
IIf([fBillSeparately],[sFile],"") AS File,
tbTest.fBillSeparately AS [Group]
FROM tbTest
GROUP BY tbTest.ClientID, tbTest.sClient,
IIf([fBillSeparately],[sFile],""),
tbTest.fBillSeparately
ORDER BY tbTest.fBillSeparately;
The two IFF function calls, when the string is executed in VBA, are the problem.
Attached is a simple Access 2002 zipped database illustrating how I'm using the string. See Form1.
Hopefully someone can help me with the syntax.
Thank you in advance for your time and trouble.