SQL statement for left outer join for ranges in the same file

W

web1

Hello,

I need a left outer join between 2 ranges in the same workbook (2
sheets). I created the sql statement using the MS-Query tool however
it references a database (the file on my C drive) and creates a
separate script file (.qdy). I have a 2 part question:

1) Can I accomplish the join where there is no concept of opening an
external database? My database is the file I am in. I need the file to
to be portable and self referencing as far as the database goes.

2) Along the same lines: can the qdy file be part of the xls file and
be executed as a macro or in VBA? I have tried using the sql directly
using sqlexecquery statement but that requires opening a database etc.
and probable other References to pass syntax check for sqlopen etc.

Instead of the sql, would it just be more efficient to use index/match
functions to do the lookup on the target range (the left outer range)
and then convert the formulas to values?

Thanks,

Manish
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top