Link to home
Start Free TrialLog in
Avatar of pressMac
pressMacFlag for United States of America

asked on

access / msmsql update query fails

Hello,

I have this sql update that does not work.  The dbo table is ms sql, and tblMembers is local access.
Error:  Syntax Error (missing operator)


UPDATE dbo_Customer
SET dbo_Customer.secFirstName = tblMembers.secondaryfirstname
INNER JOIN tblMembers
ON dbo_Customer.MembershipID = cstr([tblMembers].[Member_ID])
Where dbo_Customer.customerID=59447;

i figure it has to be simple, but i have fiddled with this for too long.
Avatar of Kelvin Sparks
Kelvin Sparks
Flag of New Zealand image

Try

UPDATE dbo_Customer
SET dbo_Customer.secFirstName = tblMembers.secondaryfirstname
FROM dbo.Customers
INNER JOIN tblMembers
ON dbo_Customer.MembershipID = cstr([tblMembers].[Member_ID])
Where dbo_Customer.customerID=59447;

Kelvin
Avatar of pressMac

ASKER

It still complains of syntax error.

Press
ASKER CERTIFIED SOLUTION
Avatar of mbizup
mbizup
Flag of Kazakhstan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Works great.  Did not occur to me to fore go the join all together.

Press
Worked great
Fwiw, I think that Access joins need to be directly on the fields,  not functions.  I don't have a database handy to verify that, though.
more fwiw, the select statement with that join does work.
Thanks for checking that.