SQL Query to a table in another excel workbook

keiranwyllie

New Member
Joined
May 12, 2017
Messages
47
Morning all,

I have a question regarding SQL queries when creating a data connection. I have created a data connection to an external workbook to a sheet that has a table in it. This table starts at row 13 (the headers) and is a dynamic table that gets updated from time to time.

In my query, I've tried:
Select * from [Sheet1$] where column4 ="Name" (This gives the error "No value given for one or more required parameters" which I think relates to the table not starting on row 1)
Select * from [Sheet1$.A13:Q10000] where column4 ="Name" (This gives a "could not find the object 'Sheet1$.A13:Q10000'. Make sure the object exists" error)

I know the data exists etc but I'm just having trouble retrieving the data (again I think it's because the table doesn't start at row 1).

Any thoughts or suggestions would be greatly appreciated.

K.
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.

Forum statistics

Threads
1,223,956
Messages
6,175,614
Members
452,661
Latest member
Nonhle

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top