Line number

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

Guest

I need to extract the line number of a query. This is for comparison and not
for a unique indentifer. My overall goal is to create a procedure that will
reset my count dates for cycle counting. I want to get an equal # of counts
for every day (some parts are counted quarterly, some semi-annual and some
yearly). I already have a way to do this, but I have to manually add an
autonumber column in a table (created from a query). My question is can I
create an autonumber column in a make table query? If so how? I could
program a function but I think there should be a "canned" solution.

please help,

Robert

ps. Thanks to ALL on this message board who take time to answer questions!
This is a great resource!
 
Hi,


In Jet, no, not directly. If your data is in a recordset, you can use its
AbsolutePosition property to get its "row number in the recordset".


There is no row number, in itself, in a table.


You can compute the rank (first, second, third,.... ) based on the data in
one column, with subquery or with join, but that is not as fast as appending
the ordered (sorted) data into a new table having an autonumber field, as
you already do, if your table has records in the thousands.


Hoping it may help,
Vanderghast, Access MVP
 
Back
Top