Hi
I don't know why is it so complicated to add an auto number field in a query.
Please see this example from Northwind , I would like to add a increment number (auto number) on each line and then an auto number on each product.
Please see examples
As my farmer grandfather used to say: You can't piss in the same river twice. Meaing, its not a static entity, its a constant flow. Queries are like rivers, they aren't static. If the underlying data changes and a row gets added, or taken away, that query isn't going to be the same the next time you run it and your numbering system is screwed.
So even if adding an 'autonumber' to a query was possible it would be pointless. So, give up on that, and instead focus on what you hope to accomplish with that autonumber. What did you think adding an autonumber would allow you to do? Maybe there's another way.
Well, the reason i am asking this is because i want to convert this query into xml and upload it. Autonumbering in reports is so easy, why not in queries. May be I should build a report and convert it to xml.
Again, think past the whole autonumber concept. What does an autonumber allow you? Essentially its a meaningless number used only to uniquely identify records. Which is the exact reason it won't work on a query for the reasons I detailed before--you can't guarantee the same rows will always be produced in the same order from query run to query run.
CJ's method is the way to go to numerate records in a query for one run, but remember it's not valid for anything else than populating a number--you can't use it to link back anything to that query.