Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

UPDATE QUERY, I WANT TO LEAVE FIELDS AS THEY ARE IF NO MATCH FOUND 1

Status
Not open for further replies.

franksirvent

Programmer
Mar 8, 2002
358
GB
Hi
I got the following UPDATE code which updates a field called 'Service' when a match is found.

However I want the Query to leave 'Service' field as it is if no record is found.

Somehow the query below BLANKS the 'Service' field if no match is found...which is not what i want it to do...

The thing is that sometimes I already have data in the 'Service' field and I don't want it to be blanked, I only want the data to be replaced if a match is found.

Any ideas ?


UPDATE [Global Buying Rates1] LEFT JOIN [BAF Rates] ON ([Global Buying Rates1].ShippingID = [BAF Rates].ShippingLine) AND ([Global Buying Rates1].POD = [BAF Rates].POD) AND ([Global Buying Rates1].POL = [BAF Rates].POT) SET [Global Buying Rates1].Service = [BAF Rates].[Texto1] WHERE ((([Global Buying Rates1].GRIID)=1478));
 
Replace this:
LEFT JOIN
with this:
INNER JOIN

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top