[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 163
  • Last Modified:

Udating a field

I have a table which contains 2 fields; Description and Color
In an update query how do I set the value of Color to "gold" if the Description field contains the word "gold" ?
0
Gary Samuels
Asked:
Gary Samuels
  • 2
  • 2
4 Solutions
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
Maybe something like this:


UPDATE Table7 SET Table7.Color = IIf(InStr(1,[Description],"Gold")>0,"Gold",[Description]);


Make a backup first - before running a test Update query.

mx
0
 
MINDSUPERBCommented:
Try this:

UPDATE Table1 SET Table1.Color = "Gold"
WHERE (((Table1.Description) Like "*" & "gold" & "*"));


Sincerely,
Ed
0
 
MINDSUPERBCommented:
This is how your query in design view looks like:


Ed
Query.PNG
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now