Hi,
I usually perform only simple SQL queries inside Excel VBA. Today I've unsuccessfully tried to add a LEFT JOIN to one of the Excel queries. It seems that when I try to add table aliases the error occurs. For instance, this works:
SELECT table.field_ID As 'ID' FROM database.table
but the following doesn't work:
SELECT t.field_ID As 'ID' FROM database.table As t
Ultimately I'd like a query that resembles the following structure:
SELECT t1.field, t2.field FROM database.table LEFT JOIN lookup As t1 ON t1.id = database.id LEFT JOIN lookup As t2 ON t2.id = database.id
Instead of using "LEFT JOIN lookup As t1" I have also tried "LEFT JOIN lookup t1" but the same error occurs: 1004 Authentication Failure. In some cases I need to shut down Excel (2013) and reload it in order to stop the error from reappearing - simply changing the query back to something that had worked earlier doesn't always work.
Any help would be appreciated.
I usually perform only simple SQL queries inside Excel VBA. Today I've unsuccessfully tried to add a LEFT JOIN to one of the Excel queries. It seems that when I try to add table aliases the error occurs. For instance, this works:
SELECT table.field_ID As 'ID' FROM database.table
but the following doesn't work:
SELECT t.field_ID As 'ID' FROM database.table As t
Ultimately I'd like a query that resembles the following structure:
SELECT t1.field, t2.field FROM database.table LEFT JOIN lookup As t1 ON t1.id = database.id LEFT JOIN lookup As t2 ON t2.id = database.id
Instead of using "LEFT JOIN lookup As t1" I have also tried "LEFT JOIN lookup t1" but the same error occurs: 1004 Authentication Failure. In some cases I need to shut down Excel (2013) and reload it in order to stop the error from reappearing - simply changing the query back to something that had worked earlier doesn't always work.
Any help would be appreciated.