I have a table with existing records and need to find the name of the person in another table and get the weekenddate
So I need to update the 1st table with the date form another table
So I need to update the 1st table with the date form another table
Code:
Update WeekAtAGlance
Set WeekAtAGlance.TimeSheetSubmittedDate =q.DateEntered
Where WeekAtAGlance.ResourceLastName = dts.ResourceLastName
And WeekAtAGlance.ResourceFirstName = dts.ResourceFirstName
from
(Select dts.DateEntered,dts.ResourceLastName, dts.ResourceFirstName from dbo.SOWTimeSheetDateSubmitted dts
Inner join WeekAtAGlance wag on dts.ResourceLastName = wag.ResourceLastName
And dts.ResourceFirstName = wag.ResourceFirstName
Where dts.WeekEndDate ='09/01/2012' ) q
[code]
Error says
Msg 156, Level 15, State 1, Line 5
Incorrect syntax near the keyword 'from'.
Msg 102, Level 15, State 1, Line 9
Incorrect syntax near 'q'.
DougP