Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Append query with autonumber 1

Status
Not open for further replies.

jlbartley

MIS
Feb 4, 2002
9
0
0
US
I have a table called FixedFields. I need to append rows from that table onto the end of the table. For example:

Table: FixedFields
Fields: InitiativeNo (autonumber),Site, OrigYear,

How do I append these records and have the InitiativeNo select the next autonumber in the sequence? The way I have it right now it wants to append the rows with the original InitiativeNo instead of grabbing a new one.

Thank you for your help!
 
Simply leave the AutoNumber field off from your SQL Insert Statement... As follows...

INSERT INTO Table1 ( bugno, Description, Reference, TESTLink, TEST234, TESTNUM )
SELECT Table4.bugno, Table4.Description, Table4.Reference, Table4.TESTLink, Table4.TEST234, Table4.TESTNUM
FROM Table4;

Where I have an ID field in Table1 that is the Primary Key and an AutoNumber.

htwh Steve Medvid
"IT Consultant & Web Master"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top