By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,479 Members | 2,239 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,479 IT Pros & Developers. It's quick & easy.

Enumerate by variable in ms access

P: 1
hello,

I would like to know if there is a way in ms access 2003 to add consequtive numbers to a new column to 'count' the records. This count should start over by every by variable. for example:

I have a table:

field1 field2 field3
1 AA BB
1 AB BC
1 AC BS
2 AA BC
2 AN BS
3 DD EE
3 EE FF

In the final situation a new table or query should be created looking like this:

field1 field2 field3 field 4
1 AA BB 1
1 AB BC 2
1 AC BS 3
2 AA BC 1
2 AN BS 2
3 DD EE 1
3 EE FF 2

A fourth column is added showing a list of consequtive numbers starting over again when in field1 a new value is found.

I hope anyone can help me!

Thanx in advance,
erik
Sep 18 '07 #1
Share this Question
Share on Google+
1 Reply


NeoPa
Expert Mod 15k+
P: 31,186
This is probably possible to do in code using recordsets Erik, but ordinal numbers is what databases are really designed to avoid. The point is they process records by treating them all as items in a bucket.
Oct 6 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.