A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

move records table to table



 
 
Thread Tools Display Modes
  #1  
Old August 23rd, 2004, 05:45 PM
Chuck H
external usenet poster
 
Posts: n/a
Default move records table to table

I have 2 tables with the same fields. How can I move the
records from one table to the other?
  #2  
Old August 23rd, 2004, 06:01 PM
tina
external usenet poster
 
Posts: n/a
Default

write a Select query to pull the correct records from Table1. change the
query to an Append query, to append the records to Table2. make a copy of
the Append query, and change the copy to a Delete query to delete the
records from Table1. run the Append query, and then the Delete query.
look up Append and Delete queries in Access Help, for details on same.
NOTE: test the queries on a *copy* of your database before using them on
"live" data.

hth


"Chuck H" wrote in message
...
I have 2 tables with the same fields. How can I move the
records from one table to the other?



  #3  
Old August 23rd, 2004, 06:19 PM
Tim Ferguson
external usenet poster
 
Posts: n/a
Default

"Chuck H" wrote in
:

I have 2 tables with the same fields. How can I move the
records from one table to the other?


Why would you want to? There is hardly ever any good reason to have two
tables with the same field structure. It usually comes about as a
misunderstanding of design basics; often one table is "ActiveCases" and the
other is "DeletedCases". This is better modelled by having one table with
all the cases, and adding a field called "Active" which can be set to True
or False. This leads to a _huge_ saving of effort down the line, not least
in terms of getting rid of duplicates (what happens when a case is in both
the Active and Deleted tables?), reporting on All Cases (yes, you can use a
Union query but that introduces all kinds of side effects), updating the
application (adding fields to two tables instead of one, doubling up all
the validation code, etc), and so on.

Oh: how to move a record from one to the other? Change the field to
"False".

Hope that helps


Tim F

  #4  
Old August 24th, 2004, 11:09 PM
Judi B
external usenet poster
 
Posts: n/a
Default

Sound database design would dictate as Tim describes for relatively small
databases. For larger databases (thousands of records) you could build a
function to periodically archive older records to text files (csv, etc) for
later retrival, if desired.

Judi B

"Tim Ferguson" wrote:

"Chuck H" wrote in
:

I have 2 tables with the same fields. How can I move the
records from one table to the other?


Why would you want to? There is hardly ever any good reason to have two
tables with the same field structure. It usually comes about as a
misunderstanding of design basics; often one table is "ActiveCases" and the
other is "DeletedCases". This is better modelled by having one table with
all the cases, and adding a field called "Active" which can be set to True
or False. This leads to a _huge_ saving of effort down the line, not least
in terms of getting rid of duplicates (what happens when a case is in both
the Active and Deleted tables?), reporting on All Cases (yes, you can use a
Union query but that introduces all kinds of side effects), updating the
application (adding fields to two tables instead of one, doubling up all
the validation code, etc), and so on.

Oh: how to move a record from one to the other? Change the field to
"False".

Hope that helps


Tim F


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Repost: Calculation problem. Someone help! Victor Running & Setting Up Queries 13 August 6th, 2004 05:21 PM
selecting multiple records sps Using Forms 3 August 3rd, 2004 08:22 PM
Tranfering records from temp table to main table filnigeria General Discussion 1 July 22nd, 2004 04:44 AM
Query combining multiple records from one table can't add records Clint Marshall Running & Setting Up Queries 4 July 8th, 2004 01:25 PM
Form doesn't pull up records from table Ed Burns Using Forms 3 June 8th, 2004 07:41 PM


All times are GMT +1. The time now is 07:38 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.