This is my first post on Access World Forums and I sure hope you can help. I have the following select statement to create an ADO recordset. When I try to run the process I get the error Incorrect syntax near '='. I have tried a full range of single and double quotes and can't seem to get it right. Can you please put me on the right path.
Thanks
"SELECT Sum(IIf([Type]= 'RESI',[Amt],0))AS Ind " & _
"Sum(IIf([Type]= 'RESM',[Amt],0))AS Med " & _
"Sum(IIf([Type]= 'RESE',[Amt],0))AS Exp " & _
"Date " & _
"FROM transaction " & _
"GROUP BY Date " & _
"WHERE ID = '" & GlobalID & "' " & _
"ORDER BY PE_Date DESC"
Thanks
"SELECT Sum(IIf([Type]= 'RESI',[Amt],0))AS Ind " & _
"Sum(IIf([Type]= 'RESM',[Amt],0))AS Med " & _
"Sum(IIf([Type]= 'RESE',[Amt],0))AS Exp " & _
"Date " & _
"FROM transaction " & _
"GROUP BY Date " & _
"WHERE ID = '" & GlobalID & "' " & _
"ORDER BY PE_Date DESC"