Solved

Query to delete Abbreviated country name in parentheses in Name column

Posted on 2011-09-18
4
375 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
I was prompted to write this article after the recent World-Wide Ransomware outbreak. For years now, System Administrators around the world have used the excuse of "Waiting a Bit" before applying Security Patch Updates. This type of reasoning to me …
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.

617 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