Database Management
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesDatabase Management

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 29th, 2003, 04:54 PM
SmokeDB SmokeDB is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 2 SmokeDB User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
String manipulation, remove suburb from address

Hello everyone,
i have entries like "76 GROSVENOR STREET ST KILDA EAST"
and "8 YAWLA STREET MCKINNON" in one column of a database.
my aim is to seperate the suburb from this address string, so it is like "8 YAWLA STREET" and "MCKINNON", where the suburb can be one two or three words. I have all the suburb names in another column and table, so i could match the address string against the suburb list. i have all this data in an access database, and an excel spreadsheet aswell, and im looking for a solution in any way possible.

Thanks for your help.

Reply With Quote
  #2  
Old November 30th, 2003, 11:08 PM
BlueGazoo BlueGazoo is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: TO
Posts: 17 BlueGazoo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Are you using Script in Access? Or just the queries?

If you're using script inside a module, you have lots of choices depending on the format of ALL fields:

If all fields include "STREET" after the street address and proceeding the suburb (with nothing following the suburb):

intStreet = instr(strAddress, "STREET")
intLength = Len(strAddress)
intSuburbLength = intLength - intStreet)
intSuburb = mid(strAddress, intStreet + 7, intSuburbLength)

(give or take an intLength)

Or better yet, since you have a database of ALL suburb Names and they will match exactly to the suburb names in the table:

Fil strSuburb(x) with all the possible suburbs
Open your table of address

While not rs.eof
for x = 0 to intNumberOfSuburbs
if instr(rs.Address, strSuburb(x)) > 0 then
rs.Suburb = strSuburb
else
rs.Suburb = "Suburb Not Found"
endif
Next
Wend

...But there is a posibility that "York" would get confused with East York, etc....

so, use a combination of both?

If you're only using querries... you would have to use something similiar in access, but im no access guy...

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesDatabase Management > String manipulation, remove suburb from address


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway