Line Numbers in a query

V

Vina

Can someone help me how I can add a line number field in
a query for each item in a group.

ex.

ITem1 100ea 11/15/2003 line 1
item1 200ea 11/15/2003 line 2
Item1 300ea 11/16/2003 line 3
ITem2 100ea 11/15/2003 line 1
item2 200ea 11/15/2003 line 2
Item2 300ea 11/16/2003 line 3

Any ideas is appreciated.

Thanks
Vina
 
A

Allen Browne

There is no *efficient* way to do this.

You could use a DCount() expression or subquery to count the number of
preceeding lines for the group. You will need some kind of key value that
uniquely identifies each line to achieve that.
 
Top