Why am I getting a Compile error on my SQL statement?
You have extra double quotes in a few spots. Try this
Src = "SELECT Orders.Order, Orders.Date, Orders.Time," & _
"Rejections.Order, Rejections.Date, Rejections.Time, " & _
"IIf(Orders.Order=Rejections.Order,Rejected,Filled ) " & _
"AS Fill_Status " & _
"FROM Rejections RIGHT JOIN Orders ON Rejections.Order=Orders.Order "
& _
"WHERE Orders.Date Now() - 42 " & _
"ORDER BY Orders.Order, Rejections.Order;"
" wrote:
Any idea what is wrong with my src statement? It is giving me a
compile error when I attempt to run the code and it highlights the
"Rejected" portion. It runs perfectly fine as a query in the database
and I can't see any quotes or anything out of place...
Thanks.
Src = "SELECT Orders.Order, Orders.Date, Orders.Time,
Rejections.Order, Rejections.Date, " & _
"Rejections.Time, " &
"IIf(Orders.Order=Rejections.Order,"Rejected","Fil led") " & "AS
Fill_Status " & _
"FROM Rejections RIGHT JOIN Orders ON
Rejections.Order=Orders.Order " & _
"WHERE Orders.Date Now() - 42 " & _
"ORDER BY Orders.Order, Rejections.Order;"
|