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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need assistance with archiving records please 1

Status
Not open for further replies.

simpsondm

IS-IT--Management
Jan 14, 2003
21
US
Can someone please help me I'm new with databases and learning as I go. I have a projects database and I need to archive closed projects to another table. I have a table called tbl_mainproj and tbl_Archproj that are identical in structure/fields I have 2 yes/no check boxes fldOpen and fldClosed when a project is Open the fldOpen is checked and when it is closed fldClosed is checked.
How can I move the records from tbl_mainproj to tbl_Archproj when fldClosed is checked and delete the record from tbl_mainproj.
Thanks for any help you can provide
 
How can I move the records from tbl_mainproj to tbl_Archproj when fldClosed is checked
INSERT INTO tbl_Archproj SELECT * FROM tbl_mainproj WHERE fldCosed = -1;
and delete the record from tbl_mainproj
DELETE FROM tbl_mainproj WHERE fldCosed = -1;

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top