Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel 2007 - Remove duplicate values when importing data from ODBC 1

Status
Not open for further replies.

jeffm777

IS-IT--Management
Nov 10, 2009
108
US
I want to create a drop down list from a named range. This named range will be a list of inventory locations from an ODBC query into my inventory. Problem is, I need this list to only show unique values. Also, I have the ODBC query set to automatically refresh upon opening the spreadsheet so I need it to query the data and return the unique list of locations automatically.

Can this be done?
 
SELECT Inventory.Location
FROM SQLUser.Inventory Inventory
 
hi,

I do this quite often. You have several options.

1) do a separate query on a separate sheet, like
Code:
select distinct [inventory location]
from [your table(s)]
where [i]whatever criteria are necessary[/i]

2) do a separate query to the Excel Sheet where the first query resides, like
Code:
select distinct [inventory location]
from [SheetName$]

3) you could use the Advanced Filter feature to make a UNIQUE list of that column.

4) you could use the PivotTable feature to make a UNIQUE list of that column.



Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
I would try:

SELECT [blue]Distinct[/blue] Inventory.Location
FROM SQLUser.Inventory Inventory [blue]
ORDER BY ...[/blue]

and see what happens

Have fun.

---- Andy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top