Counting Records

E

Eric

Hello all,

As you will probably be able to guess by this question I am a complete novice to access but I really need to add record numbers to a query as described below.

I have a query based on two tables which amongst others has a field that returns one of two answers (Route A or Route B) is it possible to add a field or code that consecutively numbers each record in the group starting with One (like using record count, running sum over group in reports)

Many Thanks for any help that you might be able to offer
 
D

Duane Hookom

You can use a subquery to generate a sequence number. For instance:
SELECT FirstName, LastName, Score,
(SELECT Count(*)
FROM tblGolfScores S
WHERE S.Score <= tblGolfScores.Score) As Rank
FROM tblGolfScores;

--
Duane Hookom
MS Access MVP


Eric said:
Hello all,

As you will probably be able to guess by this question I am a complete
novice to access but I really need to add record numbers to a query as
described below.
I have a query based on two tables which amongst others has a field that
returns one of two answers (Route A or Route B) is it possible to add a
field or code that consecutively numbers each record in the group starting
with One (like using record count, running sum over group in reports)
 

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