Transfer values form one table field to another

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a field BookedDate in my Events table.
For various reasons I now want to have that field in my Inquiries table.
How can I copy/transfer the existing entries in Events.BookedDate, into the
new field Inquiries.BookedDate?
Is this a job for an Update Query? (If so I have never done one, so please
explain!)
Many thanks
CW
 
CW,

You can only transfer these values to the "right" records if a relationship
exists between Inquiries and Events. Presumably Inquiries is the many side
of a one-to-many, linked by EventID.

If such a relationship exists, however, you don't need or want the
BookedDate field in the detail table; get it through a query linking the two
tables, and base your forms and reports on the query.

Storing the same data two different places makes it more difficult to
maintain data integrity. Think of a customer order database where the
customer address is stored with each order--if the address should change,
you'll have to change it in every order rather than just once in the Customer
table.

Hope that helps.
Sprinks
 
Sprinks -
Thanks for your helpful advice but perhaps I didn't make it clear - I am not
proposing to have the data in two places, I want to MOVE the field and its
existing entries, completely out of one table and into another.
Obviously it's no problem to create the new field itself, but my question
is, how to get the data across into its new location??
Many thanks
CW
 
CW,

If the tables have a common field, you can add the BookedDate field to the
Inquiries table definition, and run an Update query which changes the value
to the value in the related Events record. If the name of the common field
is EventID, the SQL is:

UPDATE Inquiries INNER JOIN Events ON Inquiries.EventID = Events.EventID SET
Inquiries.BookedDate = [Events].[BookedDate];

Hope that helps.
Sprinks
 

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

Back
Top