Thanks for your help! this did the trick:
UPDATE [mfgtest803].[dbo].[partplant]
SET [reschedindelta] = '15'
FROM [mfgtest803].[dbo].[partplant] JOIN [mfgtest803].[dbo].[partWhse] ON ([partplant].[partnum]=[partWhse].[partnum])
WHERE (([partplant].[partnum]
NOT IN
(SELECT [partWhse].[partnum] FROM [mfgtest803].[dbo].[partWhse] WHERE [partWhse].[WarehouseCode]<>'120'))...
User Profile
Collapse
-
got it - thanks. I will give that a try. I will need the sub-q.Leave a comment:
-
thanks CG! That was it. (sorry about the bolding)
I now have this q:
UPDATE [mfgtest803].[dbo].[partplant]
SET [reschedindelta] = '15'
FROM [mfgtest803].[dbo].[partplant] JOIN [mfgtest803].[dbo].[partWhse] ON ([partplant].[partnum]=[partWhse].[partnum])
WHERE (([partplant].[safetyqty]>'0')OR([partplant].[minimumqty]>'0'))AND
(([partWhse].[WarehouseCode]='120') AND([partWhse].[WarehouseCode]<>'320'))...Leave a comment:
-
Update using a join in the where clause
I am trying to run this update qry in SQL Server:
UPDATE [mfgtest803].[dbo].[partplant]
SET [reschedoutdelta] = '1'
WHERE ([partplant].[partnum] = [partWhse].[partnum])AND
(([partplant].[safetyqty]>'0')OR([partplant].[minimumqty]>'0'))AND
([partWhse].[WarehouseCode]='120')
I get the following errors:
Msg 4104, Level 16, State 1, Line 1
The multi-part...
No activity results to display
Show More
Leave a comment: