Link to home
Start Free TrialLog in
Avatar of jbervin
jbervin

asked on

Excel Query

I am trying to add a field reference or range name to the selection criteria in an excel query but don't see a way to do so. Here is the simple sql statement:

SELECT `Test Eq`.`Site ID`, `Test Eq`.Tag, `Test Eq`.Make, `Test Eq`.Model, `Test Eq`.Serial, `Test Eq`.Location, `Test Eq`.Belts, `Test Eq`.`Belts Qty`, `Test Eq`.Filters, `Test Eq`.`Filters Qty`
FROM `Test Eq.csv` `Test Eq`
WHERE (`Test Eq`.`Site ID`=100004)

I'd like the WHERE to read  `Test Eq`.`Site Id`= `nameofcurrentworkbook`.`nameofrange`

Is this possible?
ASKER CERTIFIED SOLUTION
Avatar of yo_bee
yo_bee
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jbervin
jbervin

ASKER

Thank you both for your help. I can't use VB script because of some server to tablet limitations, but i will try the assignment approach.
Avatar of jbervin

ASKER

To Yo BEE: thanks for your response, but it really doesn't address the problem: I don't want to have to enter the site id, i want to get it from a cell on the worksheet.
Avatar of jbervin

ASKER

Not sure if the one I awarded most points to will work, but i want to close the question.
@JBERVIN
I am not sure what you mean by enter the SiteID

Do you have an example of the data you are trying to query?