From: IgorM on
Hi

How to get distinct items from a recordset? Let's assume I have two columns
returned from a database: countries and cities.
I want to retrieve a list of unique country names.


Kind regards
IgorM

From: Jarek Kujawa on
Excel 2003
Data->Filter->Advanced->select your ranges and tick "Unique records
only"


On 23 Mar, 09:26, "IgorM" <ig...(a)live.com> wrote:
> Hi
>
> How to get distinct items from a recordset? Let's assume I have two columns
> returned from a database: countries and cities.
> I want to retrieve a list of unique country names.
>
> Kind regards
> IgorM

From: Bob Phillips on
Igor,

Why don't you make the query return a distinct set?

--

HTH

Bob

"IgorM" <igorm(a)live.com> wrote in message
news:DC376AB8-6964-4F36-9E1B-92A97582C07E(a)microsoft.com...
> Hi
>
> How to get distinct items from a recordset? Let's assume I have two
> columns returned from a database: countries and cities.
> I want to retrieve a list of unique country names.
>
>
> Kind regards
> IgorM


From: Mike H on
Hi,

List in data in columns A & B
The will treat the top row as a header row. Select the list of countries and
then

Data|Filter|Advanced filter
Select 'Copy to another location'
Check 'Unique records only'
Click the icon in the 'Copy to' box and select a single cell to copy to
Click the icon again.
OK

You now have a unique list of countries. I copied mine to column M so M2 is
the first country and M1 is the header. Put this in N2 and drag down as far
as required.

=VLOOKUP(M2,$A$2:$B$100,2,FALSE)


--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"IgorM" wrote:

> Hi
>
> How to get distinct items from a recordset? Let's assume I have two columns
> returned from a database: countries and cities.
> I want to retrieve a list of unique country names.
>
>
> Kind regards
> IgorM
>
From: IgorM on
Its probably me not being too specific. I don't want to query the database
to restrict connections to database.

I've been thinking about dumping values from a recordset to a collection and
using the values as a collection key too. But is there a better way to do
that - a buid-in unique filtering function.


U�ytkownik "Bob Phillips" <bob.phillips(a)somewhere.com> napisa� w wiadomo�ci
grup dyskusyjnych:OTgcbrmyKHA.5936(a)TK2MSFTNGP04.phx.gbl...
> Igor,
>
> Why don't you make the query return a distinct set?
>
> --
>
> HTH
>
> Bob
>
> "IgorM" <igorm(a)live.com> wrote in message
> news:DC376AB8-6964-4F36-9E1B-92A97582C07E(a)microsoft.com...
>> Hi
>>
>> How to get distinct items from a recordset? Let's assume I have two
>> columns returned from a database: countries and cities.
>> I want to retrieve a list of unique country names.
>>
>>
>> Kind regards
>> IgorM
>
>