Alex (al**@totallynerd.com) writes:
Hopefully this is a simple fix, but I keep getting Syntax error with
this statement in an MS SQL DTS statement and in Query Analyzer:
Update A Set A.deptcode = A.deptcode,
A.type = A.Type,
a.TotalExpenseUnit = (a.LaborExpenseUnit + a.OtherExpenseUnit)
Where a.Type in ('FYTD04', 'Prior Year','Budget')
From Data_Unsorted A Join Data_Unsorted B On
A.deptcode = B.deptcode and A.type = B.Type
Below is the error from Query Analyzer:
Server: Msg 156, Level 15, State 1, Line 5
Incorrect syntax near the keyword 'From'.
Where do I place my Where..In statement since I only want to limit the
Update to run for items where a.type is FYTD04, Prior Year, or Budget?
WHERE always comes after the FROM clause.
There is a syntax diagram for UPDATE in Books Online.
--
Erland Sommarskog, SQL Server MVP,
so****@algonet.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp