Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access 2007

Status
Not open for further replies.

dawnd3

Instructor
Jul 1, 2001
1,153
US
I am wondering if there is a way to number records in a table or query, 1,2,1,2 or yes, no, yes, no, something like that? This would be a list of duplicates where I would want to separate out one set to keep and one set to delete. (I have a little procedure that gets rid of dups and updates the related tables.) I can do this through Excel, just wondering if I can save myself a step.

Dawn

 
To number them in a table add a field of type autonumber with an increment of 1.

The number won't get reset if you delete rows, just bear in mind to ignore this field as part of your duplicate checking as no two rows will have the same number, so all will be unique.

John
 
I want them to just have a 1 or a 2, no unique numbers.

 
You need to provide a method that determines which record in the duplicate is numbered 1 and which is 2. Records are like marbles in a bag with no order so you must have some type of primary key field or fields that identify individual records.

Duane
Hook'D on Access
MS Access MVP
 
I don't care which is 1 and which is 2, I just want it to alternate all the way down the column. The records will be sorted so that they are next to their duplicate. I am probably just not thinking clear on this one. I should just stick to the method I have using Excel, LOL. :)

 
How are ya dawnd3 . . .

Lets say you accomplish your alternate 1,2 sequence. [blue]How will you determine wether to delete 1 or 2?[/blue] [green]It is this determination that needs to be incorporated in the WHERE Clause of a Delete query or SQL![/green]

[blue]Your Thoughts? . . .[/blue]

See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top