I need to update a field in a table with the data coming from a secondary table.
I have used something like the following in the past to do this.
Update ITEMBL a
Set a.UUD1IB =
(Select Coalesce(Max(b.PAPPRDT),0) As ApprvDate
From PLNREQ b
Where b.PAPPRDT > 0 And
a.ITNBR = b.PITEM And
a.HOUSE = b.PWH)
My problem this time is that I only want to update the ITEMBL record if there is
a record in the UPDATELIST and the following query fails because not all the
items in ITEMBL are in the UPDATELIST. How would I modify this query to update
only the items that are in the UPDATELIST table?
Update ITEMBL t1
Set UUD1IB = (
From UPDATELIST t2
Where t1.HOUSE = t2.WAREHOUSE And
t1.ITNBR = t2.ITEM)
Any help would be appreciated.