Note that there are some explanatory texts on larger screens.

plurals
  1. POexcel 2010 vba. sql query over columns 'like' vlookup
    primarykey
    data
    text
    <p>I have a "Filename.accdb" (2010) file to which I established a connection with Excel's VBA.</p> <p>Let's say that within the file I have a TableA:</p> <pre><code>Column1 Column2 Worker ------- ------- ------- Text1 Text2 15 Text3 Text4 4 ... Text5 Text6 20 </code></pre> <p>And a TableB:</p> <pre><code>ID Name ------- ------- 1 Name1 4 Name4 15 Name15 ... 20 Name20 </code></pre> <p>I am able to import those tables into a worksheet, but what I'd like to achieve is this:</p> <p>Desired query result (I don't want the whole TableA):</p> <pre><code>Column1 Worker ------- ------- Text1 Name15 Text3 Name4 ... Text5 Name20 </code></pre> <p>At the moment, I am importing both tables separately and then writing the values of the "Name" column into the "Worker" column. I achieve this with a for loop and the function Vlookup(...). It's fast and works fine, so what is my problem?</p> <p>Well, it generates plenty of code and I am sure that it must be possible by a sql query. Also, I think I would learn a lot from this as I am quite new to sql.</p> <p>This is my string so far ...</p> <pre><code>sql = "SELECT TableA.Column1, TableA.Worker, TableB.Name " &amp; _ "FROM TableA " &amp; _ "LEFT JOIN TableB " &amp; _ "ON TableB.ID = TableA.Worker" </code></pre> <p>It doesn't work and throws the "... cannot perform join on multiple fields error ..." I couldn't find a solution for me in the internet.</p> <p>Does anyone see the problem? What am I doing wrong?</p> <p>Thanks in advance Cheers</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload