Solved

Query to delete Abbreviated country name in parentheses in Name column

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

932 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

10 Experts available now in Live!

Get 1:1 Help Now