L lcook1974 Registered User. Local time Yesterday, 20:02 Joined Dec 21, 2007 Messages 330 Jan 26, 2011 #1 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
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
Brianwarnock Retired Local time Today, 01:02 Joined Jun 2, 2003 Messages 12,701 Jan 26, 2011 #2 Use Instr or InstrRev to find the position of the Hyphen and Mid or Right to extract the data. Brian
V vbaInet AWF VIP Local time Today, 01:02 Joined Jan 22, 2010 Messages 26,374 Jan 26, 2011 #3 Look into the Split() function or Right() and InStr()
Brianwarnock Retired Local time Today, 01:02 Joined Jun 2, 2003 Messages 12,701 Jan 26, 2011 #4 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
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
L lcook1974 Registered User. Local time Yesterday, 20:02 Joined Dec 21, 2007 Messages 330 Jan 26, 2011 #5 I'm on it...I'll post some code if it doesn't work. Thanks vbaInet!
Brianwarnock Retired Local time Today, 01:02 Joined Jun 2, 2003 Messages 12,701 Jan 26, 2011 #6 lcook1974 said: I'm on it...I'll post some code if it doesn't work. Thanks vbaInet! Click to expand... Oh guess I'm invisible Brian
lcook1974 said: I'm on it...I'll post some code if it doesn't work. Thanks vbaInet! Click to expand... Oh guess I'm invisible Brian
V vbaInet AWF VIP Local time Today, 01:02 Joined Jan 22, 2010 Messages 26,374 Jan 26, 2011 #7 Brianwarnock said: 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 Click to expand... Oh yes, that's right Brian. I was actually thinking of Mid() Brianwarnock said: Oh guess I'm invisible Click to expand... You shouldn't have retired so early
Brianwarnock said: 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 Click to expand... Oh yes, that's right Brian. I was actually thinking of Mid() Brianwarnock said: Oh guess I'm invisible Click to expand... You shouldn't have retired so early
L lcook1974 Registered User. Local time Yesterday, 20:02 Joined Dec 21, 2007 Messages 330 Jan 26, 2011 #8 My Bad Brian...you are not invisible! I apologize! Thank you to you both!!