Record Numbers

  • Thread starter Thread starter nommy
  • Start date Start date
N

nommy

Hi,

Is there any sql query which can retrieve records from a
table such that in the result the first field displays the
record number.

For Example:- There is a table which contains over 1000
records. Now running a query which displays all the
records such that the first field should display the
record numbers
Plz reply ASAP

Thanks,
Nommy.
 
Hi,


Not (right out of the box) with Jet. The safest and still fast way to
do it would be to insert the data into a new table having an autonumber
field (not replicated, not random ) and to append your SELECTED results
into it (without specifying any value for the autonumber field). The result
would be in the table. If you use a split design (back-end, front-end), I do
not see any reason to have that table in the back-end, built it in the front
end application.


Hoping it may help,
Vanderghast, Access MVP
 
"select count(*) as numbers from table"
there are rs.fields("numbers") records

Paal
 
Is there any sql query which can retrieve records from a
table such that in the result the first field displays the
record number.

No, since Access tables do not have record numbers.

Follow Michel's suggestion if you want to add a new field containing a
static record number; Paal's if you want to dynamically count records
retrieved by a query (bearing in mind that Record 31 today might be
Record 18 tomorrow).
 
Back
Top