alankwan
asked on
How to retrieve data with running number using access query ?
How to retrieve datas with running number using access query ? eg. i got three data ...then show me 1 ... 2 .. 3 ...
ASKER
thank you ...but it not works if i got 'where' clause to filter data
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
If you have a numeric primary key field in your table, autonumber is good, you can do something like this:
SELECT (Select count(*) from TheTable where ID <=T.ID) AS [Counter], T.ID
FROM TheTable AS T
Returns:
Counter ID
1 1
2 2
3 3
4 5
Alan