I'm not sure about how to do it in a query but I've done it in a report using:
in the controlsource of a textbox in the detail section. It is only useful for display purposes anyway. If you were to delete a record, for instance, the number in this textbox will change by one in all the subsequent records.
i've tried the options given for microsoft... but they dont work form me... actually , im using an autonumber field... but... how to compact the database with a macreo, in order to reset the autonumber to 1 each time i need it?