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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is it possible to seperate addresses? House number from street name

Status
Not open for further replies.

nemmeh

Technical User
Jul 7, 2003
30
US
Hey everyone. :)

Ok, I've got a question.

If I have a field, say "Address" and it contains a full address ie " 1392 Old Highway 342 ". Is there a way I create query a query that will take the 1st set of numbers it sees and insert them into a new field called "House_No".

So for instance, in this case it would take 1392 from the Address field and stick it in "House_No" leaving only Old Highway 342 in the "Address" field.

I know I can't use a standard left() or right(), because the house number can be anywhere from 2-6 digits in some cases. ie. "845 E 4th Street" or "39992 HWY 62". So it needs to look for the first set of numbers before a space hits. I know in some cases I'll get some errors, but I can go back and correct those later.
 
If your addresses are consistent, you could try:
HouseNum:Left([FullAddress],Instr([FullAddress]," ")-1)

Duane
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top