In VBA code you can issue multiple requests on the same connection, but the wizard expects only a single data-returning SQL statement. It is submitting all the entered SQL above as one multi-statement request, which is invalid.
Ahead of time, you could create and load permanent tables to support this query, or probably even create global temporary tables and include both the INSERTs to populate instances of the GTT and the SELECT in the SQL passed to the wizard. But not CREATE.
In VBA code you can issue multiple requests on the same connection, but the wizard expects only a single data-returning SQL statement. It is submitting all the entered SQL above as one multi-statement request, which is invalid.
Ahead of time, you could create and load permanent tables to support this query, or probably even create global temporary tables and include both the INSERTs to populate instances of the GTT and the SELECT in the SQL passed to the wizard. But not CREATE.