MS Access Function that Returns a Sequence Number in a Query

R

robboll

I have Access 2003.

I am looking for a function that will sequence Col1, Col2, and Col3 as
follows:

Table1
Function:
Col1 Col2 Col3 SeqNo
1 1 a 1
1 1 c 2
1 1 d 3
1 2 a 1
1 2 f 2
1 2 g 3
1 2 j 4
1 3 b 1
1 3 g 2
2 1 a 1
2 1 i 2
2 2 e 1
2 2 h 2
2 2 k 3

The query orders columns 1,2, and 3 and the function should return
incremental values accordingly for each group.

Any help with this greatly appreciated.

RBollinger
 
J

John Vinson

I have Access 2003.

I am looking for a function that will sequence Col1, Col2, and Col3 as
follows:

Table1
Function:
Col1 Col2 Col3 SeqNo
1 1 a 1
1 1 c 2
1 1 d 3
1 2 a 1
1 2 f 2
1 2 g 3
1 2 j 4
1 3 b 1
1 3 g 2
2 1 a 1
2 1 i 2
2 2 e 1
2 2 h 2
2 2 k 3

The query orders columns 1,2, and 3 and the function should return
incremental values accordingly for each group.

Any help with this greatly appreciated.

SeqNo: DCount("*", "[Table1]", "[Col1] <= " & [Col1] & " AND [Col2] <=
" & [Col2] & " AND Col3 <= '" & [Col3] & "'")

John W. Vinson[MVP]
 
R

robboll

cool -- thanks

John said:
I have Access 2003.

I am looking for a function that will sequence Col1, Col2, and Col3 as
follows:

Table1
Function:
Col1 Col2 Col3 SeqNo
1 1 a 1
1 1 c 2
1 1 d 3
1 2 a 1
1 2 f 2
1 2 g 3
1 2 j 4
1 3 b 1
1 3 g 2
2 1 a 1
2 1 i 2
2 2 e 1
2 2 h 2
2 2 k 3

The query orders columns 1,2, and 3 and the function should return
incremental values accordingly for each group.

Any help with this greatly appreciated.

SeqNo: DCount("*", "[Table1]", "[Col1] <= " & [Col1] & " AND [Col2] <=
" & [Col2] & " AND Col3 <= '" & [Col3] & "'")

John W. Vinson[MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top