External Data Query

Hobbes

New Member
Joined
Sep 13, 2006
Messages
1
I am running Excel 2002 SP3 and have created an external data query to our SQL database. I am trying to pull out a cost field based on a sku entered in an adjacent cell. The SQL looks like this:

SELECT invntry.invn_std_cost
FROM bes_prod.dbo.invntry invntry
WHERE (invntry.invn_sku_cd=?) AND (invntry.invn_loc_cd='WPG1')

So I use the parameters option to tell it to get the value from a certain cell, lets say A1. It puts in =Sheet1!$A$1, so I remove the $ to eliminate the static refrence, and everything works fine, it puts the information into B1. But if I try to fill down the query to additional cells, it does not update the parameter refrence, it keeps defaulting to A1, is there anyway to make this value change as the query is moved around? I have hundreds of skus on this sheet, and it creates a new query for each one, it becomes unmanageable.

Thank you for any help
 

Some videos you may like

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple

Watch MrExcel Video

Forum statistics

Threads
1,113,861
Messages
5,544,721
Members
410,630
Latest member
JFORTH97
Top