StaticVoid
New Member
- Joined
- Oct 24, 2014
- Messages
- 10
Hello!
I have a query to pass to mySQL database through Power Query. In essence, it looks like this:
It is a part of more complex query that joins several tables . In my workbook I have a list of names ("abc", "xyz" etc.). Loading entire table and matching it in power query is not an option, because it is too large.
My idea was to concatenate the names in one cell, make a dynamic range and refer them in PowerQuery:
It is secure since database only allows select queries.
The problem is that concatenated names often exceed maximum number of characters allowed in Excel cell, so I'm looking for a way to pass a VBA string variable to PQ. Any alternative solutions are welcome as well.
I'm using Excel 2010 Pro Plus.
Thank you!
I have a query to pass to mySQL database through Power Query. In essence, it looks like this:
Code:
SELECT *
FROM table
WHERE
col1 LIKE "%abc%" OR
col1 LIKE "%xyz%" OR
....
It is a part of more complex query that joins several tables . In my workbook I have a list of names ("abc", "xyz" etc.). Loading entire table and matching it in power query is not an option, because it is too large.
My idea was to concatenate the names in one cell, make a dynamic range and refer them in PowerQuery:
Code:
QueryPart = Excel.CurrentWorkbook(){[Name="MyTable"]}[Content][MyColumn]{0}
Source = MySQL.Database("server", "database", [Query="SELECT * FROM table WHERE " & QueryPart])
The problem is that concatenated names often exceed maximum number of characters allowed in Excel cell, so I'm looking for a way to pass a VBA string variable to PQ. Any alternative solutions are welcome as well.
I'm using Excel 2010 Pro Plus.
Thank you!