[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 687
  • Last Modified:

access vba inner join update

Syntax error. I need some help with an inner join in vba. Newbie stuff.. Thx
sSql = "UPDATE CData INNER JOIN pdata_positions ON (pdata_positions.Field13 = CData.ID) SET CData.name = pdata_positions.name;"

Db.Execute sSql

Open in new window

0
BillTr
Asked:
BillTr
  • 3
2 Solutions
 
Kelvin SparksCommented:
sSql = "UPDATE CData SET CData.name = pdata_positions.name FROM CData INNER JOIN pdata_positions ON (pdata_positions.Field13 = CData.ID) ;"

Kelvin
0
 
BillTrAuthor Commented:
Sorry, that is giving me a runtime error  3075
0
 
BillTrAuthor Commented:
got it.

UPDATE [Pace-boa_eod_positions] INNER JOIN ComplianceData ON [Pace-boa_eod_positions].Field13 = ComplianceData.Cusip SET ComplianceData.ausi = [Pace-boa_eod_positions]![Ausi];"
0
 
hnasrCommented:
Agree:
In general,
UPDATE table1 INNER JOIN table2 ON table1.joinField1 = table2.joinField2
SET table1.fieldToUpdate = table2.fieldToUpdateWith
0
 
BillTrAuthor Commented:
My solution was valid... but hnasr improved on it.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now