CrazyJo
Mar 11 2008, 08:26 AM
One field - Address. It contains the street address and the PO Box address. I want to extract the data starting with "PO Box" and the information to the right of it. Any suggestions?
stevecreedon
Mar 11 2008, 08:31 AM
Hi,
Can you give us an example of the data in the field 'Address'?
CrazyJo
Mar 11 2008, 08:34 AM
32 E Market St PO Box 72
I want only the information starting with PO Box and what ever follows.
fkegley
Mar 11 2008, 08:50 AM
You can use InStr to find the phrase PO Box:
In a query,
P: InStr(1, [FieldName], "PO Box")
P1: Mid$([FieldName], P)
P will be the position where PO Box starts
P1 then will be the portion of the original field that begins with PO Box
CrazyJo
Mar 11 2008, 09:05 AM
OK- you are to advanced for me - when I put this in the query I receive an error.
Instr(1,[Address],"PO Box")Mid$([Address],P)
fkegley
Mar 11 2008, 09:24 AM
Each belongs in its own Field: cell in the query.
CrazyJo
Mar 11 2008, 09:33 AM
That fixed the problem. Thank You!
domenick2x
Mar 11 2008, 10:13 AM
Won't that run into issues if there's a P in the address, as in:
1234 Davis Place PO Box 1234
??
fkegley
Mar 11 2008, 12:16 PM
You're welcome. I am glad I could help.
fkegley
Mar 11 2008, 12:17 PM
No, I am finding PO Box---the entire phrase, not just the P.
domenick2x
Mar 11 2008, 12:23 PM
QUOTE
No, I am finding PO Box---the entire phrase, not just the P.
Right, sorry. I hit super-dyslexia on that one.
fkegley
Mar 11 2008, 12:45 PM
No problem, thanks for checking me---I do make mistakes from time to time, more often than I will admit in public.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.