Hi Experts
I have a spreadsheet that connects to an external source using ODBC using the connection from the ODBC 64-bit App. This data source imports information based on the LOTID. Currently the only way I know to change the LOTID is to go into Power Query Editor and click Source which shows the SQL statment being used to retrieve the data. I manually change the WHERE statment to the LOTID that I want to import.
Whilst this works, I would rather be able to pass a variable to the Connection and it either changes the LOTID in the SQL statment or just imports the entire SQL statment including the new LOTID. The only thing that changes in the SQL statement is the LOTID. Example:
Select
Reports.*,
Lots.Customer,
Lots.Description
FROM
Units_Reports Reports
INNER JOIN
Lots ON Reports.LotID = Lots.LotID
WHERE Reports.LotID = 1238
Not sure if an elegant solution is possible.
Cheers
Jack
I have a spreadsheet that connects to an external source using ODBC using the connection from the ODBC 64-bit App. This data source imports information based on the LOTID. Currently the only way I know to change the LOTID is to go into Power Query Editor and click Source which shows the SQL statment being used to retrieve the data. I manually change the WHERE statment to the LOTID that I want to import.
Whilst this works, I would rather be able to pass a variable to the Connection and it either changes the LOTID in the SQL statment or just imports the entire SQL statment including the new LOTID. The only thing that changes in the SQL statement is the LOTID. Example:
Select
Reports.*,
Lots.Customer,
Lots.Description
FROM
Units_Reports Reports
INNER JOIN
Lots ON Reports.LotID = Lots.LotID
WHERE Reports.LotID = 1238
Not sure if an elegant solution is possible.
Cheers
Jack