Update Query
-
- 5StarLounger
- Posts: 627
- Joined: 03 Feb 2010, 15:02
Update Query
I have a table that has a field "Region (By Cl County)" that has some data that needs changed. Some of the data should be "CR - Middle Market Central" but the data is showing "CR ? Middle Market Central". I want to change all the data that says "CR ? Middle Market Central" to "CR - Middle Market Central". How would I do this in an update query? Thanks for your help.
-
- Administrator
- Posts: 78416
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Update Query
You could use the Replace dialog, but if you prefer to use an update query:
UPDATE [tblData] SET [Region (By Cl County)] = "CR - Middle Market Central"
WHERE [Region (By Cl County)]="CR ? Middle Market Central"
where tblData is the name of the table.
UPDATE [tblData] SET [Region (By Cl County)] = "CR - Middle Market Central"
WHERE [Region (By Cl County)]="CR ? Middle Market Central"
where tblData is the name of the table.
Best wishes,
Hans
Hans
-
- 4StarLounger
- Posts: 504
- Joined: 23 Jul 2010, 18:36
- Location: Westlake, OHIO
Re: Update Query
update tablename set region = replace
(region, 'CR ? Middle Market Central','CR - Middle Market Central')
(region, 'CR ? Middle Market Central','CR - Middle Market Central')
Who will you Inspire today?
-
- 5StarLounger
- Posts: 627
- Joined: 03 Feb 2010, 15:02
Re: Update Query
Thank you. I used the GUI and put
Like * CR ? Middle Market Central" in the criteria
and
CR - Middle Market Central in the Update to
Like * CR ? Middle Market Central" in the criteria
and
CR - Middle Market Central in the Update to
-
- Administrator
- Posts: 78416
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Update Query
That should work, but be aware that it would also change "CR A Middle Market Central" or "CR 9 Middle Market Central" (or any character in place of ?) to "CR - Middle Market Central".
(Probably not a real problem)
(Probably not a real problem)
Best wishes,
Hans
Hans