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

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).

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,137,292
Messages
5,680,648
Members
419,923
Latest member
Kalthus

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