Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using the like operator with the Instr function

Status
Not open for further replies.

leahyj

MIS
May 5, 2004
107
US
Anybody have an idea how to use the Like operator within the Instr function. Example:
Left([CityStateZip],Instr(1,[CityStateZip], Like "* ?? *"))

Field [CityStateZip] value = COVINGTON KY 41011-1227

 
Have you tried this ?
Split([CityStateZip])(1)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Well,

Thanks for the Split tip, but I don't have the Split function available and in my many years coding with vba using access, I have never heard or seen split.
 
What version of Access are you using? I don't think it is available in 97, but It definitely is in 2003 and I think it is in 2000.

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
Unfortunately,

version 97 at work, where I need it and at home I have xp.
 
If you search the vba fora, you should find a few examples of writing a roll your own Split function.

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
I am all set. Thanks to everyone. I ended up doing what I know already.

City: Mid([CityStateZip],1,InStr(1,[CityStateZip],"-")-9)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top