Manual Incremental numbering By Query (1 Viewer)

A

ash_nash01

Guest
undefinedundefinedhello all

I have a query that i need to count it manually for example

SELECT Senority.Pamphle_Title
FROM ListPamplets AS Senority;

I need something as mentioned below where count increases by 1 everytime a matching record is forund. I already have a unique ID as ID.

No Pamphle_Title
1 ACTM
2 Aids action
3 Australian Adverse Drug Bulletin
4 Child Health Dialogue
5 Communicable Diseases Intelligence
6 Community Eye Health
7 Community Training Update

Thanks all.
 

Jon K

Registered User
Joined
May 22, 2002
Messages
2,209
You can use a subquery to number the results.

SELECT (Select Count(*) from ListPamplets as S where S.[Pamphle_Title]<=[Senority].[Pamphle_Title]) AS [No], [Pamphle_Title]
FROM ListPamplets AS Senority
ORDER BY [Pamphle_Title];


Note
If the table is large, running the subquery will take time. With a large table, you may consider using VBA.
.
 
Last edited:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top Bottom