Re: Duplicates numbered
- From: "Duane Hookom" <DuaneAtNoSpanHookomDotNet>
- Date: Thu, 12 Oct 2006 15:38:16 -0500
Try:
SELECT ID, Colors, (SELECT COUNT(*) from Color C WHERE C.Colors =
Color.Colors AND C.ID <= Color.ID) as Number
FROM Color;
--
Duane Hookom
MS Access MVP
"Céline Brien" <celinebrien@xxxxxxxxxxxxxxxxx> wrote in message
news:ORdAPjh7GHA.5020@xxxxxxxxxxxxxxxxxxxxxxx
Hi everybody,
I forgot to had that each color has a unique number :
ID Colors Number
1 red 1
2 red 2
3 red 3
4 green 1
5 green 2
6 Blue 1
7 Blue 2
8 Blue 3
Thanks,
Céline
"Céline Brien" <celinebrien@xxxxxxxxxxxxxxxxx> a écrit dans le message de
news: Og%23Ykeh7GHA.4500@xxxxxxxxxxxxxxxxxxxxxxx
Hi everybody,
Hi Duane,
Thank you very much for your answer.
You are absolutely right.
As a matter of fact, I created the table Color with the result of the
query to find duplicates.
My question reformulated is :
In a query using the table Color, containing the field Colors, I would
like to number the duplicates in the field Number
Colors Number
red 1
red 2
red 3
green 1
green 2
Blue 1
Blue 2
Blue 3
Many thanks for your help,
Céline
"Duane Hookom" <DuaneAtNoSpanHookomDotNet> a écrit dans le message de
news: %23F4y2tg7GHA.2120@xxxxxxxxxxxxxxxxxxxxxxx
You can't number records in a query without having a field in the
table/query that can be used to "rank" the records. Could you provide
more information on what your records look like and how you want to rank
them?
--
Duane Hookom
MS Access MVP
"Céline Brien" <celinebrien@xxxxxxxxxxxxxxxxx> wrote in message
news:%23%23WKNmg7GHA.4064@xxxxxxxxxxxxxxxxxxxxxxx
Hi everybody,
I created a query to find duplicates.
I would like to number the duplicates.
red 1
red 2
red 3
green 1
green 2
Blue 1
Blue 2
Blue 3
Either in the same query or in another query based on this one.
Many thanks,
Céline
.
- Follow-Ups:
- Re: Duplicates numbered
- From: Céline Brien
- Re: Duplicates numbered
- From: Céline Brien
- Re: Duplicates numbered
- References:
- Duplicates numbered
- From: Céline Brien
- Re: Duplicates numbered
- From: Duane Hookom
- Re: Duplicates numbered
- From: Céline Brien
- Re: Duplicates numbered
- From: Céline Brien
- Duplicates numbered
- Prev by Date: Re: Crosstab query ODBC Fails - AYS2000
- Next by Date: Re: How do I calculate times over multiple records?
- Previous by thread: Re: Duplicates numbered
- Next by thread: Re: Duplicates numbered
- Index(es):
Relevant Pages
|