Solved

Query to delete Abbreviated country name in parentheses in Name column

Posted on 2011-09-18
4
366 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
Comment Utility
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
Comment Utility
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
Comment Utility
Oh sorry I gave you an excel answer. Go with mbizup's answer!
0
 

Author Comment

by:JackJackson54
Comment Utility
Worked really good.  Thanks
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

762 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now