Click here to Skip to main content
15,892,298 members
Please Sign up or sign in to vote.
1.11/5 (2 votes)
See more:
How to Generate Serial Number Column in MS Access Query along with other Records.

For Eg .

AAA 32
BBB 12
CCC 23

Output Should be :

1 AAA 32
2 BBB 12
3 CCC 23
Posted

Add an Identity column to your database with the type "Autonumber".
 
Share this answer
 
Comments
Member 13325894 21-Jan-18 9:34am    
thanks
It can be achieved using DCOUNT() Function Specifying relative ref. to required col.
 
Share this answer
 
It is not possible to write such kind of query on Ms Access Table to have serial number at the time of executing query only. You have to add a column in Ms Access Table as describe in previous answer to get Serial Number in Output.
 
Share this answer
 
It IS actually possible to write SQL that returns a row number. http://www.eggheadcafe.com/software/aspnet/30187160/query-row-number.aspx[^]

Of course, it makes more sense to add an identity column.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900