Solved

Query to delete Abbreviated country name in parentheses in Name column

Posted on 2011-09-18
4
371 Views
Last Modified: 2012-05-12
I need to get rid of the country abbreviation in parentheses always at then end of a horse name as follows:

Blue Jay Attack
Pack Your Bags
Dahoud (NZ)
Royal F J
Format V.
Cardiff Giant
Unico Lider (ARG)
Suances Sweetheart
Suances Flower
Ever Ask Me Again
Nana Beach
Miss Bold Topper
Misty Carmel

The two in the above are (NZ) and (ARG) that I need to delete from column Name.  It could be (GB), (FR), (PER), etc. , but is always in parentheses.

This is a column of about 200k names of various length
0
Comment
Question by:JackJackson54
  • 2
4 Comments
 
LVL 10

Expert Comment

by:plummet
ID: 36556326
Hi,

Try this formula in A2 if the first horse name is in A1, otherwise edit the formula.

=IF(LEN(SUBSTITUTE(A1,"(",""))=LEN(A1),A1,LEFT(A1,FIND("(",A1)-1))

I hope it helps!
0
 
LVL 61

Accepted Solution

by:
mbizup earned 500 total points
ID: 36556466
Backup your data and try this:

UPDATE YourField
SET YourField = iif(Right(YourField,1) = ")", TRIM(Left(YourField,  instr(1,YourField,"(")-1)),YourField)
0
 
LVL 10

Expert Comment

by:plummet
ID: 36556511
Oh sorry I gave you an excel answer. Go with mbizup's answer!
0
 

Author Comment

by:JackJackson54
ID: 36556741
Worked really good.  Thanks
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Recently Microsoft released a brand new function called CONCAT. It's supposed to replace its predecessor CONCATENATE. But how does it work? And what's new? In this article, we take a closer look at all of this - we even included an exercise file for…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question