duplicate record counter field

Erick

Active Member
Joined
Feb 26, 2003
Messages
360
I have a query and one of the fields return have non-unique records (i.e there are duplicate & triplicates, and so on), call this field 'block'.

I need to create another field in this query so that the first time a record appears in the 'block' field, this new field will return '1', and then the second time the same record appears again, it will return '2' and so on. So it is kind of like a duplicate counter.
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand

mdmilner

Well-known Member
Joined
Apr 30, 2003
Messages
1,352
Have you thought about using the Find Duplicates Wizard interface built into Access to produce something like:

Code:
SELECT tblName.Field1, Count(*)
FROM tblName
GROUP BY tblName.Field1
HAVING (((Count(*))>1));

Mike
 

Forum statistics

Threads
1,171,683
Messages
5,876,884
Members
433,217
Latest member
Muhammad Tanzeel Ur Rehma

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top