Delete
Delete

Reputation: 299

Creating a Temporary Incrementing Number in an MS Access Query

I am writing a query which will return data that is needed for an export/import into a MySQL database. One of the required fields in the MySQL database is an id field. Currently, the data that I am trying to export does not have an id field but will need one for this export process.

Is there a way within the Access select query to make a number that increments for all the records that are in the result set (i.e., it starts at 1 and goes to 100 lets say if there are 100 records returned)?

Upvotes: 1

Views: 580

Answers (2)

HansUp
HansUp

Reputation: 97101

Make the MySQL id field auto_increment type and let MySQL handle the numbering.

Upvotes: 2

Donal
Donal

Reputation: 32713

Create a new AutoNumber field on that table in Access. You may have to create a new table. You can copy the existing table into a new table that includes an autonumber field. The instructions can be found here: How to reset an AutoNumber field value in Access

Upvotes: 1

Related Questions