Extract Right words to "-"

lcook1974

Registered User.
Local time
Yesterday, 20:02
Joined
Dec 21, 2007
Messages
330
I have a report that people put a location in as county but labeled like this:

Some type of event - Countyname County

How do I get just the "Countyname County" so I can group on that in a report?


Larry
 
Use Instr or InstrRev to find the position of the Hyphen and Mid or Right to extract the data.

Brian
 
Look into the Split() function or Right() and InStr()
 
Actually if you use Right you have to look at Len aswell, I prefer the following
assuming that County names do not contain hyphens

Mid(yourfield,InstrRev(yourfield,"-")+2)

Brian
 
I'm on it...I'll post some code if it doesn't work.

Thanks vbaInet!
 
My Bad Brian...you are not invisible! I apologize! :)

Thank you to you both!!
 

Users who are viewing this thread

Back
Top Bottom