eshurak
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
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.
How can I get this to work in SQL Server and why is it not now? Thanks
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#));
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'));
How can I get this to work in SQL Server and why is it not now? Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER