Dear thanks, I just need a column in query which shows row numbers for that particular records in queryThere is a conceptual problem here. If you have no ID (or any other type of field) that you can use to provide order to your query, you can number the rows but those numbers will mean nothing. If you update any field in any record in that table, the numbers will be different the next time you open that query.
This happens because your underlying table has no inherent order - particularly since you denied having a usable ID field. Therefore, unless you can provide at least some semblance of a field to support a sort order, your query-based number will be useful only for picking random lottery numbers. Look through the articles linked below in the "Similar Threads" section to see if you get any ideas.
Try this Google search: "Can I add an autonumber field to an access table?"
You haven't answered the questions raised by @theDBguy and @The_Doc_Man with regards to whether a unique field exists, without understanding how records in the table are organised, it might be difficult to advise well.Dear thanks, I just need a column in query which shows row numbers for that particular records in query
Both of these methods require a unique column in the table to create the sequence on.
The mileage is both unique and ordered and makes a good natural PK. It is always increasing. AFAIK you cannot drive a car and then fill up without the mileage increasing and being unique. I guess you can worry about the case where the odometer fails and you reset it or get a new odometer. At that point it is probably a new query.If you don't have a unique candidate key, use an autonumber.
Do you know something we don't know about the OP's databaseThe mileage is both unique and ordered and makes a good natural PK.
No. I just read what the OP wrote.Do you know something we don't know about the OP's database![]()
Thanks. Definitely the wrong post.@MajP - are you perhaps confusing this person with someone else? I just looked at all four of JAQ's posts and NONE of them mention mileage. Can you point to the post with the word mileage? Because your point is well taken, but either you have a PM from this person or your crystal ball is working and mine is on the fritz.