Link to home
Start Free TrialLog in
Avatar of eshurak
eshurakFlag for United States of America

asked on

Move Access update query to SQL Server

Hello,

I'm trying to convert an update query with an Inner Join created in Access to run on SQL Server.

In access it's
UPDATE tblCensus INNER JOIN tblFacilityInfo ON tblCensus.NHID = tblFacilityInfo.nhid SET tblCensus.Batch = 3
WHERE (((tblFacilityInfo.DateSched1)>#10/28/2011#));

Open in new window


Which works but when I paste it into an SQL Server query I get the following errors.

Msg 156, Level 15, State 1, Line 7
Incorrect syntax near the keyword 'INNER'.
Msg 102, Level 15, State 1, Line 9
Incorrect syntax near 'tblFacilityInfo'.

I did change my SQL Server query to deal with the DateTime field.

UPDATE tblCensus SET tblCensus.Batch = 3
INNER JOIN dbo.tblFacilityInfo ON dbo.tblCensus.NHID = dbo.tblFacilityInfo.nhid         
WHERE (((tblFacilityInfo.DateSched1)> '10/28/2011 00:00:00:000'));

Open in new window


How can I get this to work in SQL Server and why is it not now?  Thanks
ASKER CERTIFIED SOLUTION
Avatar of Shaun Kline
Shaun Kline
Flag of United States of America 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
Avatar of eshurak

ASKER

So just missing the "From"  Thanks.