What makes the first record, the first record?
That is not so obvious. If you answer: "it is the first one which is
displayed by Access when I open the table", then, that is a really ...
dangerous... answer. You see, records, in a table, are like candies in an
Halloween bag of candies: they are, right now, in 'a', 'one', given order,
but shake the bag a little (add/erase some records) and your candies can
move in what can appear like chaos. That is one of the big difference
between a database table and a spreadsheet (where the candies, the rows,
will stay in a relative position to each other, even if you insert, move, or
delete some 'other' rows).
So, what makes the first record, the first record? It has to be the values
in a field of the record. Generally, a good choice is a date_time_stamp, the
date and time value when the record has been added to the table!
So, if your table has fields like:
client someInfo dateTimeStamp ' fields name
then, the first query can be:
SELECT a.client, COUNT(*)
FROM myTable AS a INNER JOIN myTable AS b
ON a.dateTimeStamp >= b.dateTimeStamp
and the second query:
SELECT a.client, COUNT(*)
FROM myTable AS a INNER JOIN myTablew AS b
ON a.client=b.client
AND a.dateTimeStamp >= b.dateTimeStamp
but you need to identify which of your field that can act for the 'order'
(who is first, who is second,... ). It is not obliged to be a dateTimeStamp.
An address can be used ( *if* it is unique, without duplicated values ),
but it is preferable to be a numeric type (faster for execution time, but to
have a result is what is the most important, in a first step).
Hoping it may help,
Vanderghast, Access MVP