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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

update query 1

Status
Not open for further replies.

samotek

Technical User
May 9, 2005
197
BG
I have an update query that updates the field "reminder" in the table tblClients. How could i change the query as not to update those records in the field "Reminder", that already exist. For example the record in the client 2 is 1234. There is no such a record in the table TblClients1.In that case i want tht the record 1234 be preserved.
Obviously i should use the words if Exist but i do not know how and where. Could you help ? My query is :
StrSQL = " UPDATE TblClients INNER JOIN TblClients1 ON TblClients.ClientID = TblClients1.ClientID SET TblClients.Reminder = [TblClients1].[Reminder]"
CurrentDb.Execute StrSQL


 
Perhaps this ?
StrSQL = "UPDATE TblClients INNER JOIN TblClients1 ON TblClients.ClientID=TblClients1.ClientID SET TblClients.Reminder=TblClients1.Reminder WHERE TblClients.Reminder Is Null"

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top