Numbering results in a query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is it possible to add a column in a query that displays the record number of
the record? I know this is possible in report view, but i use the mail merge
option in word. I figured this would be the easiest way to perserve the
record number in word. Thank you.
 
Record numbers have absolutely no value and no meaning in Access. Record
numbers are relative to the current recordset and are also dependant on
filtering and sorting, as well as insertions and deletions. That means that
the same record will likely have a different record number each time a
recordset is retrieved from the database. It is, therefore, never a good idea
to use record numbers for anything, because they relate to nothing.
 
Thank you for your help Klatuu, but actually i managed to find exactly what i
wanted.

RowNum: (Select Count (*) FROM [tblName] as Temp
WHERE [Temp].[ID] < [tblName].[ID])+1

This numbered all of the rows (sorry i should have used correct
terminology). The IDs need to be in numerical order for this to work
correctly. But it did work.
 
Back
Top