R
RC
What is needed here appears to be very similar to restarting a numbering
sequence in a query each time the value in a specific field changes. The
example below shows what is desired in a query of a table named RECORDS ---
where the numbering sequence in the LABEL_ORDINAL field restarts each time
the value in the LABEL field changes:
LABEL LABEL_ORDINAL
ABC 1
ABC 2
ABC 3
ABC 4
DEF 1
DEF 2
DEF 3
DEF 4
GHI 1
GHI 2
JKL 1
JKL 2
JKL 3
Yet, when I tried the following in SQL view:
SELECT a.LABEL, Count(*) AS LABEL_ORDINAL
FROM RECORDS AS a INNER JOIN RECORDS AS b
ON a.LABEL = b.LABEL
GROUP BY a.LABEL;
The results in the query look like this below, which is not the desired
outcome:
LABEL LABEL_ORDINAL
ABC 16
DEF 16
GHI 4
JKL 9
What will I need to do get it to work?
Thanks,
sequence in a query each time the value in a specific field changes. The
example below shows what is desired in a query of a table named RECORDS ---
where the numbering sequence in the LABEL_ORDINAL field restarts each time
the value in the LABEL field changes:
LABEL LABEL_ORDINAL
ABC 1
ABC 2
ABC 3
ABC 4
DEF 1
DEF 2
DEF 3
DEF 4
GHI 1
GHI 2
JKL 1
JKL 2
JKL 3
Yet, when I tried the following in SQL view:
SELECT a.LABEL, Count(*) AS LABEL_ORDINAL
FROM RECORDS AS a INNER JOIN RECORDS AS b
ON a.LABEL = b.LABEL
GROUP BY a.LABEL;
The results in the query look like this below, which is not the desired
outcome:
LABEL LABEL_ORDINAL
ABC 16
DEF 16
GHI 4
JKL 9
What will I need to do get it to work?
Thanks,