Hi,I have a SQL 2005 table (dbo.LSR_Prep_Samples_Temp) that needs updates from a 2nd SQL table (dbo.LSR_Prep_Build_Results). The problem is that dbo.LSR_Prep_Build_Results may contain 2 or more updates for the same row in dbo.LSR_Prep_Samples_Temp. I therefore need to update the same fields in a specific order from dbo.LSR_Prep_Build_Results. The dbo.LSR_Prep_Build_Results table doesn't contain a timestamp - however it does contain an Id field (PK_Id) which is incremented (by 1) and is unique.When I try the following statement I get an error msg (Msg 156, Level 15, State 1, Line 13Incorrect syntax near the keyword 'ORDER'). UPDATE dbo.LSR_Prep_Samples_TempSETResult = R.Result,Date_Received = R.Date_Reviewed,Date_Started = R.Date_Reviewed,Date_Completed = R.Date_Reviewed,Date_Reviewed = R.Date_Reviewed,Third_Party_Id = R.Third_Party_IdFROM dbo.LSR_Prep_Samples_Temp S LEFT JOIN dbo.LSR_Prep_Build_Results R ONR.AB_Id = S.AB_Id ANDR.ACode = S.ACodeORDER BY R.PK_Id
Having read through a few similar postings on the web I can't find an appropriate solution.Any ideas please?Thanks in advance,Neal