Please see if you can adapt the following to your cause.
update hdr
set fld = case when h.ShipToNo IS NULL THEN c.Zip
ELSE s.Zip END
FROM hdr h inner join CusFil c on h.CusNo = c.CusNo
inner join ShipFil s on h.ShipToNo = s.ShipToNo
where h.(pk_field) = hdr.(pk_field)
Regards,
Rehan
Main Topics
Browse All Topics





by: TimCotteePosted on 2007-03-02 at 03:44:04ID: 18639519
Update Hdr Set Hdr.Fld = Case When Hdr.ShipToNo = '' Then CusFil.CusNo Else ShipFil.ShipToNo End From Hdr Inner Join CusFil On Hdr.CusNo = CusFil.CusNo Inner Join ShipFil On Hdr.ShipToNo = ShipFil.ShipToNo
Perhaps.