Hi,
I'm dealing with address fields which I normally don't have trouble with. . .I'll typically use Left, Mid, Right to pull out the component of the address (i.e. 123 main st, baltimore, MD 20122). Now I've got one that is inconsistent that I don't know what to do with.
I need to parse it to:
Address1
Address2
Zip
They strings are always comma delimited, but some have 3 parts and some have 4. They are either of 2 ways:
123 main st, baltimore, MD 20122
123 main st, suite 100, baltimore, MD 20122
I don't care about the city and state since I'll use the zip code for that. . .A simple Right(Trim([Address]),5) Gives me that.
I also won't have trouble with address1 because it is always to the left of the first comma (Left$([address,InStr(1,[ProvName],",")-1))
What I don't know how to do is to put an IIf in there somehow to pull address2 (using MID), but only when it is a four part address.
Has anyone done something like this before?
Thanks so much for any help!
I'm dealing with address fields which I normally don't have trouble with. . .I'll typically use Left, Mid, Right to pull out the component of the address (i.e. 123 main st, baltimore, MD 20122). Now I've got one that is inconsistent that I don't know what to do with.
I need to parse it to:
Address1
Address2
Zip
They strings are always comma delimited, but some have 3 parts and some have 4. They are either of 2 ways:
123 main st, baltimore, MD 20122
123 main st, suite 100, baltimore, MD 20122
I don't care about the city and state since I'll use the zip code for that. . .A simple Right(Trim([Address]),5) Gives me that.
I also won't have trouble with address1 because it is always to the left of the first comma (Left$([address,InStr(1,[ProvName],",")-1))
What I don't know how to do is to put an IIf in there somehow to pull address2 (using MID), but only when it is a four part address.
Has anyone done something like this before?
Thanks so much for any help!