Cross-posted from:
http://social.msdn.microsoft.com/For...6-75973e57ff54
I'm also assuming you're trying to use this function:
http://allenbrowne.com/func-concat.html
I have never heard of ConcatRelated before finding that page.
Original line:
Code:
MYSQL = MYSQL & "CONCATRELATED(EXCCEX, E01, A.CABNRO=E01.EXCNRO) "
There are a couple things going wrong here:
- You need to call this function outside of the query. Currently, you're trying to use CONCATRELATED() as if it were part of the MySQL standard functions, which it isn't.
- You're trying to use CONCATRELATED() as part of your results in the main SELECT query, which will not connect as part of your results set, but rather it is likely that it will just repeat the same thing for every row, which I assume you don't want. In MS Access this is possible, but Excel VBA using MySQL? Probably not.
Here's how it *might* work, but I can't verify:
Code:
MYSQL = MYSQL & CONCATRELATED("EXCCEX", "BDYOBEL.AIPDTA.AIPCAB A LEFT OUTER JOIN BDYOBEL.AIPDTA.AIPEXC E01 ON A.CABNRO=E01.EXCNRO", "A.CABNRO=E01.EXCNRO")
Give that a shot, though I doubt it will work like you need it to.
To be honest, for this situation, I think your best bet is to execute a regular query that gets you:
A.CABNRO E01.EXCCEX
90001 500
87000 400
90001 450
90001 300
87000 500
76005
And then run a VBA script that will transpose it for you. We can help you with that if you like.
Bookmarks