Increment field by 1 on insert Query

D

Dale

I want to be able to insert a whole bunch of records from one table into
another table using a query. I need to be able to set/increase the value of a
field that is a number with each row it inserts. Most people will say to have
it as an autonumber field but that is not an option here. Any ideas on how to
do this?

Sample data
Joe1, Address1, City2, Train1
Joe2, Address2, City3, Train4
Joe3, Address3, City1, Train2

Inserted into table sample
1, Joe1, Address1, City2, Train1
2, Joe2, Address2, City3, Train4
3, Joe3, Address3, City1, Train2
 
D

Duane Hookom

This can be done in a query using a ranking column to generate an
incrementing number. This depends on you describing the sort order of the
records being inserted.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top