Solved

Query to delete Abbreviated country name in parentheses in Name column

Posted on 2011-09-18
4
370 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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

My experience with Windows 10 over a one year period and suggestions for smooth operation
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

778 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