gi11ies
Programmer
- Mar 26, 2002
- 52
Hi, I wish to write a query that orders values in an address book database by town, and then street ... in a simple database like the following:
id : autonumber
name : text
street: text
town: text
area: text
postcode: text
email: text
telephone: text
I know a simple query like the following will do:
SELECT * FROM addressbook ORDER BY town, street;
BUT
what if the street names are like:
15 Any Street, and 26 This Street etc etc etc
Is there anyway of stripping the street name fields value so it orders it by street name? Such as in the query, have it look up the first space in the street field, and order it by the next character, which should be the first character of the street name?
The existing basic database I already have is pretty full, and I dont want to have to add another field for Street Number into it, and have to edit every single current street, so I have street number and street name ie [26] [This Street].
Any suggestions on how to get around this? or if its possible?
Gillies
id : autonumber
name : text
street: text
town: text
area: text
postcode: text
email: text
telephone: text
I know a simple query like the following will do:
SELECT * FROM addressbook ORDER BY town, street;
BUT
what if the street names are like:
15 Any Street, and 26 This Street etc etc etc
Is there anyway of stripping the street name fields value so it orders it by street name? Such as in the query, have it look up the first space in the street field, and order it by the next character, which should be the first character of the street name?
The existing basic database I already have is pretty full, and I dont want to have to add another field for Street Number into it, and have to edit every single current street, so I have street number and street name ie [26] [This Street].
Any suggestions on how to get around this? or if its possible?
Gillies