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

Conversion of Queries Access to SQL -Update Query 1

Status
Not open for further replies.

Silvertri

Programmer
Aug 26, 2002
21
AU
same situation as previous post, this one is an update query, I have done all the obvious changes however getting syntax error no experience with real SQL queries only Access

TIA Silvertri

UPDATE (tblMainDetails INNER JOIN tblParamsMembers ON tblMainDetails.IncidentNameAlpha = tblParamsMembers.CurrentIncident) INNER JOIN tblOptionsStrategiesAction ON tblMainDetails.IncidentName = tblOptionsStrategiesAction.IncidentName SET tblOptionsStrategiesAction.IncidentController = tblParamsMembers.Members
WHERE (((tblParamsMembers.CurrentIncident)='@param5') AND ((tblParamsMembers.NormalAssign)='Incident Controller') AND ((tblOptionsStrategiesAction.APNo)='@param8'));
 
Try this:

Code:
UPDATE o
SET IncidentController = p.Members
FROM tblMainDetails m
  JOIN tblParamsMembers p ON m.IncidentNameAlpha = p.CurrentIncident
  JOIN tblOptionsStrategiesAction o ON m.IncidentName = o.IncidentName
WHERE p.CurrentIncident = @param5
  AND p.NormalAssign = 'Incident Controller'
  AND o.APNo = @param8

--James
 
G'day James, thanks for the assistance, I would never have got the syntax right on this one!!!
 
Hi James
Excelent 1 star 4 that one!

I still had one problem though, the collate, so I added: COLLATE SQL_Latin1_General_CP1_CI_AS
(after the join section, before the where section)
And "it ate it" ;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top