Hello,
I had this query works for MS SQL, but getting error running it for Access DB.
The error output is:
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'SUM(CASE WHEN pgProducts.prodType='DVR' THEN pgRMAprods.itemQty END)'.
I guessed it can be query different between MS SQL and Access but don't know what is, please help.
I had this query works for MS SQL, but getting error running it for Access DB.
Code:
"SELECT pgRMAprods.prodSerialNo, " _
& " SUM(CASE WHEN pgProducts.prodType='DVR' THEN pgRMAprods.itemQty END) AS countDVR, " _
& " pgProducts.prodDesc " _
& "FROM pgRMAprods " _
& "INNER JOIN pgProducts " _
& " ON pgRMAprods.idProduct = pgProducts.idProduct " _
& "WHERE pgRMAprods.idRMA = " & validSQL(rmaID,"I") & " " _
& "GROUP BY pgRMAprods.prodSerialNo, pgProducts.prodDesc " _
& "ORDER BY pgProducts.prodType DESC"
The error output is:
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'SUM(CASE WHEN pgProducts.prodType='DVR' THEN pgRMAprods.itemQty END)'.
I guessed it can be query different between MS SQL and Access but don't know what is, please help.