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

Update Table A with Values from Table B 1

Status
Not open for further replies.

LimitedTech

Technical User
Aug 4, 2008
71
US
I have two tables;
Carriers
SafetyData

IF Carriers.USDOT MATCHES SafetyData.DotNumber
I want the DRSEA Field (in Carriers Table) to update to the DSEA field (from SafetyData).

I am not SQL Literate and use the Query grid to make the queries I need. I was attempting this using the "Update" query but can't figure it out. It seems like it should be a simple thing. The Access Help gives this example;

DSum("[Quantity]*[UnitPrice]",
"Order Details","[ProductID]=" & [ProductID])

Where the Product IDs in the current table match the Product IDs in the Order Details table, updates sales totals based on the product of Quantity and UnitPrice
Which seems close except I don't want to sum anything, I just want to update a field. I haven't been able to successfully modify it.

Thanks for your help!
 
try this query --
Code:
UPDATE SafetyData
INNER 
  JOIN Carriers 
    ON Carriers.USDOT = SafetyData.DotNumber 
   SET SafetyData.DSEA = Carriers.DRSEA

r937.com | rudy.ca
Buy my new book Simply SQL from Amazon
 
Worked Great!!
(except that I wanted the Carriers table to update instead of SafetyData but a minor switch np)
Thanks for your help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top