UPDATE TBL_Orders
SET Ord_InvFullAddress =
(SELECT COALESCE (Addr_Name + Char(13) + char(10), '') +
COALESCE (Addr_AddrLine1 + Char(13) + char(10), '') +
COALESCE (Addr_AddrLine2 + Char(13) + char(10), '') +
COALESCE (Addr_Region + Char(13) + char(10), '') +
COALESCE (Addr_Town + Char(13) + char(10), '') +
COALESCE (Addr_State + Char(13) + char(10), '') +
COALESCE (Addr_Zip + Char(13) + char(10), '') +
COALESCE (Addr_Country + Char(13) + char(10), '')
FROM TBL_Addresses
WHERE Addr_Kind = Ord_AddrKind AND Addr_Code = Ord_InvAddrCode)
WHERE Ord_AddrKind = 'C'
|