Ok basically I need to copy the details of a main client to a new sub client related to that client.
so updating the address details of one Sub client (say with a code S1) with that of a Main client (M1)
UPDATE User_file
SET address1 =(SELECT Address1 FROM User_file WHERE (Code = @Main_Client)),
address2 =(SELECT Address2 FROM User_file WHERE (Code = @Main_Client)),
address3 =(SELECT Address3 FROM User_file WHERE (Code = @Main_Client)),
address4 =(SELECT Address4 FROM User_file WHERE (Code = @Main_Client)),
Postcode =(SELECT Postcode FROM User_file WHERE (Code = @Main_Client)),
DX =(SELECT DX FROM User_file WHERE (Code = @Main_Client)),
Tel_Day =(SELECT Tel_Day FROM User_file WHERE (Code = @Main_Client)),
Tel_Eve =(SELECT Tel_Eve FROM User_file WHERE (Code = @Main_Client)),
Tel_Mob =(SELECT Tel_Mob FROM User_file WHERE (Code = @Main_Client)),
Fax =(SELECT Fax FROM User_file WHERE (Code = @Main_Client))
WHERE code = @sub_client
so updating the address details of one Sub client (say with a code S1) with that of a Main client (M1)
UPDATE User_file
SET address1 =(SELECT Address1 FROM User_file WHERE (Code = @Main_Client)),
address2 =(SELECT Address2 FROM User_file WHERE (Code = @Main_Client)),
address3 =(SELECT Address3 FROM User_file WHERE (Code = @Main_Client)),
address4 =(SELECT Address4 FROM User_file WHERE (Code = @Main_Client)),
Postcode =(SELECT Postcode FROM User_file WHERE (Code = @Main_Client)),
DX =(SELECT DX FROM User_file WHERE (Code = @Main_Client)),
Tel_Day =(SELECT Tel_Day FROM User_file WHERE (Code = @Main_Client)),
Tel_Eve =(SELECT Tel_Eve FROM User_file WHERE (Code = @Main_Client)),
Tel_Mob =(SELECT Tel_Mob FROM User_file WHERE (Code = @Main_Client)),
Fax =(SELECT Fax FROM User_file WHERE (Code = @Main_Client))
WHERE code = @sub_client