Hello Forum!

I'm trying to query a DB2 via VBA by using a string-function in the statement like this:

SELECT ... FROM ... LEFT JOIN ... ON LEFT(string, 4) ...

The thing is, that the DB2 seemed to have problem with the SQL/JET string-function LEFT. I also tried to use the SQL-DB2-conform string-function SUBSTR, but there I get also a SQL-TOKEN-Error-Message from VBA. When I use MS Access as a front-end for the DB2 by linking to the tables, there are no problems by using the left-string-function in the SQL-Statement.

Perhaps I used the wrong Syntax or is there any other possibility to realize it?