Hello all,
I have the following piece of a query that is causing a Run-time error'3075', Syntax error (missing operator) in query expression. The query works directly in Access as a Pass Through and it works in MySQL Query Browser, but it won't in VBA for some reason and I suspect that it is one of the MySQL Functions (LEFT, RIGHT, LENGTH, MAKETIME or TIMESTAMP) that is really causing the error. Can anybody else confirm or deny?
Code:
strSQLa = " SELECT dps.ACDLITE_NAME,cca.SHORTNAME AS SITE " _
& " ,(CASE WHEN LENGTH(dps.TIME) = 4 THEN TIMESTAMP(ddps.STATISTIC_DATE, MAKETIME(LEFT(dps.TIME,2),RIGHT(dps.TIME,2),0)) " _
& " WHEN LENGTH(dps.TIME) = 3 THEN TIMESTAMP(ddps.STATISTIC_DATE, MAKETIME(LEFT(dps.TIME,1),RIGHT(dps.TIME,2),0)) " _
& " WHEN LENGTH(dps.TIME) = 2 THEN TIMESTAMP(ddps.STATISTIC_DATE, MAKETIME(0,RIGHT(dps.TIME,2),0)) " _
& " WHEN LENGTH(dps.TIME) = 1 THEN TIMESTAMP(ddps.STATISTIC_DATE, MAKETIME(0,0,0)) END) AS ACT_DATETIME " & vbNewLine