SQL Query to a table in another excel workbook

keiranwyllie

New Member
Joined
May 12, 2017
Messages
32
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.
 

Some videos you may like

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.

Watch MrExcel Video

Forum statistics

Threads
1,127,843
Messages
5,627,215
Members
416,230
Latest member
jdaitchman

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
Top