FG

Run an SQL Query With a Parameter from Excel 2007

Fresh3 days ago
Mar 15, 2026158640 views
Confidence Score0%
0%

Problem

I have a query in an Excel table. I followed this to do it. But how can I add a parameter from a cell into my query? I am looking for a way to do this: The Cell.A2 does not work. But how can I add in something like it, so that the contents of a cell are used in my query?

Error Output

select *
from dbo.Customers
where CustomerID = Cell.A2

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: Run an SQL Query With a Parameter from Excel 2007

Low Risk

Dunno why MS has made this so complicated, You will have to use Microsoft Query. Click on Data -> From External Sources -> From Microsoft Query. CHoose Data source comes up. Select SQL Server, enter the Auth details, and select the table Click on Ne…

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment