how to move records from one table to the other

J

Jan

Hello,

please help me. I would like to move records from one table (called xx) to
table called (xx-backup) by clicking on a button. This action will be
repeated weekly and will be used for all records. I need to move the records
and then delete them from table xx and have them just in table xx-backup.

Please help. Thank you
 
D

Douglas J. Steele

Pardon my asking, but why? Why not just mark them as inactive, and have
everything in one single table? That's far easier should you need queries
that look at historic information.

However, in answer to your specific question, you'd need two queries: an
Append query

INSERT INTO xx-backup(Field1, Field2, Field3)
SELECT Field1, Field2, Field3 FROM xx

and an Delete query:

DELETE FROM xx

You may wish to put them in a transaction, so that the delete doesn't happen
unless the append was successful.
 

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