Combine multiple UPDATE queries (1 Viewer)

jimward

New member
Local time
Yesterday, 19:36
Joined
Jan 15, 2015
Messages
3
I would like to combine 4 UPDATE queries into a single query but don't know how. The four queries are:

UPDATE tblToDeeds INNER JOIN tblProperties ON tblToDeeds.ToDeedID = tblProperties.PropID SET tblToDeeds.TransfDate = [tblProperties].[OwnDate];

UPDATE tblToDeeds LEFT JOIN tblProperties ON tblToDeeds.ToDeedID = tblProperties.PropID SET tblToDeeds.ToDeed_Text = [tblProperties].[Deed];

UPDATE tblProperties RIGHT JOIN tblToDeeds ON tblProperties.PropID = tblToDeeds.PropID SET tblToDeeds.FromDeed_Text = [tblProperties].[Deed];

UPDATE tblToDeeds SET tblToDeeds.TransfDate_text = CStr(Format([TransfDate],"yyyy/mm/dd"));

Can anyone help?
Thanks in advance
Jim...
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 19:36
Joined
Oct 29, 2018
Messages
21,358
Hi Jim. If you're updating multiple tables, I don't think you'll be able to use just one query. You may need a separate query for each table. I could be wrong though.
 

Pat Hartman

Super Moderator
Staff member
Local time
Yesterday, 22:36
Joined
Feb 19, 2002
Messages
42,981
When you don't know the syntax for a type of query, try building it with the QBE. You will see that you can include multiple columns in the Set clause.

However, since you have a way to join the two tables, there is NO REASON to store the data twice. Just join the two tables when you need data from the second table as well as the first. Duplicating the data simply opens a path to data anomalies where the values of a common field are different in the two tables. And you especially never want to store dates as strings.
 

Users who are viewing this thread

Top Bottom