Forums
This topic is locked
creating a search by postcode query
Posted 16 Mar 2005 16:52:07
1
has voted
16 Mar 2005 16:52:07 harpal padwal posted:
hello!I need to create a search faciltity that will display all postcode records within either 10, 15, 20, 30, 50+ miles from an entered postcode ny the user.
similar to the search in www.autotrader.co.uk.
Im using ASP with an access database.
How can this be done?
Replies
Replied 16 Mar 2005 18:34:19
16 Mar 2005 18:34:19 Chris Charlton replied:
Wow, good question. I've always wondered how to go about this. There must be some way to grab radius zip codes, and just use miles to represent boundries of those neighboring zip codes.
Hope someone has a link/tip.
~ ~ ~ ~ ~ ~ ~
Chris Charlton <i>- DMXzone Manager</i>
<font size=1>[ Studio MX/MX2004 | PHP/ASP | SQL | XHTML/CSS | XML | Actionscript | Web Accessibility | MX Extensibility ]</font id=size1>
Hope someone has a link/tip.
~ ~ ~ ~ ~ ~ ~
Chris Charlton <i>- DMXzone Manager</i>
<font size=1>[ Studio MX/MX2004 | PHP/ASP | SQL | XHTML/CSS | XML | Actionscript | Web Accessibility | MX Extensibility ]</font id=size1>
Replied 17 Mar 2005 02:23:25
17 Mar 2005 02:23:25 Andrew Scott replied:
I've actually done this.
The SQL was a bit of a pain, but I got there in the end.
A working example can be found at www.housepound.co.uk/postcodes
You only need to enter the first part of any postcode (e.g. if you wanted to find all the postcodes within however many miles of ME13 2BJ, you should just enter ME13).
You can also find out the distance between any two postcodes from the same page (again, you just need to enter the first part of the postcode).
let me know if that's the sort of thing you're interested in.
And yes - I know the logo says "Housepound.com", but I haven't yet put anything up on housepound.com, because I'm basically using housepound.co.uk as a plaything to test some stuff before housepound.com goes properly live, so don't expect a massive amount of content from the housepound.co.uk site just yet <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>.
The SQL was a bit of a pain, but I got there in the end.
A working example can be found at www.housepound.co.uk/postcodes
You only need to enter the first part of any postcode (e.g. if you wanted to find all the postcodes within however many miles of ME13 2BJ, you should just enter ME13).
You can also find out the distance between any two postcodes from the same page (again, you just need to enter the first part of the postcode).
let me know if that's the sort of thing you're interested in.
And yes - I know the logo says "Housepound.com", but I haven't yet put anything up on housepound.com, because I'm basically using housepound.co.uk as a plaything to test some stuff before housepound.com goes properly live, so don't expect a massive amount of content from the housepound.co.uk site just yet <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>.
Replied 17 Mar 2005 16:43:46
17 Mar 2005 16:43:46 Dave Thomas replied:
this would be awesome.
andrew, i tried the site but the data i entered didn't seem to do anything.
is the search set up, or are you still working on it?
regards
Dave Thomas
<b>DMX Zone Manager</b>
andrew, i tried the site but the data i entered didn't seem to do anything.
is the search set up, or are you still working on it?
regards
Dave Thomas
<b>DMX Zone Manager</b>
Replied 17 Mar 2005 16:51:46
17 Mar 2005 16:51:46 Andrew Scott replied:
Hi, Dave.
Yes the site is working.
Can you let me know exactly what details you entered?
(Remember - it only works at what is known as "Postcode District" level, so you should only enter the first part of any postcode - e.g. for B46 5KH, you would ONLY enter B46 along with the number of miles or kilometres to search within.)
Yes the site is working.
Can you let me know exactly what details you entered?
(Remember - it only works at what is known as "Postcode District" level, so you should only enter the first part of any postcode - e.g. for B46 5KH, you would ONLY enter B46 along with the number of miles or kilometres to search within.)
Replied 17 Mar 2005 18:01:57
17 Mar 2005 18:01:57 Dave Thomas replied:
my bad <img src=../images/dmxzone/forum/icon_smile_wink.gif border=0 align=middle>
it works brilliantly <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle> please tell me your gonna share how to do this.
regards
Dave Thomas
<b>DMX Zone Manager</b>
it works brilliantly <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle> please tell me your gonna share how to do this.
regards
Dave Thomas
<b>DMX Zone Manager</b>
Replied 17 Mar 2005 21:44:30
17 Mar 2005 21:44:30 Chris Charlton replied:
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>...it works brilliantly <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle> please tell me your gonna share how to do this.<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
Yes, and any incite about U.S. Postal Codes would be awesome... I'm the yankey in the group, haha.
~ ~ ~ ~ ~ ~ ~
Chris Charlton <i>- DMXzone Manager</i>
<font size=1>[ Studio MX/MX2004 | PHP/ASP | SQL | XHTML/CSS | XML | Actionscript | Web Accessibility | MX Extensibility ]</font id=size1>
Yes, and any incite about U.S. Postal Codes would be awesome... I'm the yankey in the group, haha.
~ ~ ~ ~ ~ ~ ~
Chris Charlton <i>- DMXzone Manager</i>
<font size=1>[ Studio MX/MX2004 | PHP/ASP | SQL | XHTML/CSS | XML | Actionscript | Web Accessibility | MX Extensibility ]</font id=size1>
Replied 17 Mar 2005 22:53:59
17 Mar 2005 22:53:59 Andrew Scott replied:
Just working on the U.S. version as we speak.
It's probably not going to be ready until the other side of the weekend though.
Also, I need to do some documentation on all of it before I release any code, but bear with me and I shall sort something out as soon as I can.
It's probably not going to be ready until the other side of the weekend though.
Also, I need to do some documentation on all of it before I release any code, but bear with me and I shall sort something out as soon as I can.
Replied 17 Mar 2005 23:32:25
17 Mar 2005 23:32:25 Chris Charlton replied:
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>Just working on the U.S. version as we speak.
It's probably not going to be ready until the other side of the weekend though. Also, I need to do some documentation on all of it before I release any code, but bear with me and I shall sort something out as soon as I can.<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
Awesome, reply in this forum thread, since I'm on the 'notify' list for this topic. <img src=../images/dmxzone/forum/icon_smile_wink.gif border=0 align=middle> <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>
~ ~ ~ ~ ~ ~ ~
Chris Charlton <i>- DMXzone Manager</i>
<font size=1>[ Studio MX/MX2004 | PHP/ASP | SQL | XHTML/CSS | XML | Actionscript | Web Accessibility | MX Extensibility ]</font id=size1>
It's probably not going to be ready until the other side of the weekend though. Also, I need to do some documentation on all of it before I release any code, but bear with me and I shall sort something out as soon as I can.<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
Awesome, reply in this forum thread, since I'm on the 'notify' list for this topic. <img src=../images/dmxzone/forum/icon_smile_wink.gif border=0 align=middle> <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>
~ ~ ~ ~ ~ ~ ~
Chris Charlton <i>- DMXzone Manager</i>
<font size=1>[ Studio MX/MX2004 | PHP/ASP | SQL | XHTML/CSS | XML | Actionscript | Web Accessibility | MX Extensibility ]</font id=size1>
Replied 18 Mar 2005 20:11:51
18 Mar 2005 20:11:51 Andrew Scott replied:
Stage 1 of the U.S.A. Zipcodes section is up now.
At the moment I'm just doing the distances between any two 5-digit ZipCodes.
Chris, perhaps you can give it a look and give me some feedback on accuracy?
It's at: www.housepound.co.uk - just click on the "Zipcodes" link on the left menu.
Edited by - Sent2Coventry on 18 Mar 2005 20:27:13
At the moment I'm just doing the distances between any two 5-digit ZipCodes.
Chris, perhaps you can give it a look and give me some feedback on accuracy?
It's at: www.housepound.co.uk - just click on the "Zipcodes" link on the left menu.
Edited by - Sent2Coventry on 18 Mar 2005 20:27:13
Replied 19 Mar 2005 02:37:43
19 Mar 2005 02:37:43 Chris Charlton replied:
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>Stage 1 of the U.S.A. Zipcodes section is up now.
At the moment I'm just doing the distances between any two 5-digit ZipCodes.
Chris, perhaps you can give it a look and give me some feedback on accuracy?
It's at: www.housepound.co.uk - just click on the "Zipcodes" link on the left menu.<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
Did a quick test, so far so good! Shows city, state, and milage between them. I like so far!
I noticed "Zip codes" has (42741 entries), is that the whole U.S.? If so, where the hell you find that listing? <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>
~ ~ ~ ~ ~ ~ ~
Chris Charlton <i>- DMXzone Manager</i>
<font size=1>[ Studio MX/MX2004 | PHP/ASP | SQL | XHTML/CSS | XML | Actionscript | Web Accessibility | MX Extensibility ]</font id=size1>
At the moment I'm just doing the distances between any two 5-digit ZipCodes.
Chris, perhaps you can give it a look and give me some feedback on accuracy?
It's at: www.housepound.co.uk - just click on the "Zipcodes" link on the left menu.<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
Did a quick test, so far so good! Shows city, state, and milage between them. I like so far!
I noticed "Zip codes" has (42741 entries), is that the whole U.S.? If so, where the hell you find that listing? <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>
~ ~ ~ ~ ~ ~ ~
Chris Charlton <i>- DMXzone Manager</i>
<font size=1>[ Studio MX/MX2004 | PHP/ASP | SQL | XHTML/CSS | XML | Actionscript | Web Accessibility | MX Extensibility ]</font id=size1>
Replied 19 Mar 2005 09:05:19
19 Mar 2005 09:05:19 Andrew Scott replied:
As far as I can tell it IS the whole US. Contiguous and otherwise, but it also includes a bunch of "Military" Zips (539 of them), for which, oddly enough, it doesn't have the Latitude/Logitude readings, so if you enter any of those to find distances between, it will foul up. I shall tidy this up shortly. Don't suppose any out there can supply the coordinates for these "military" zips? (You know - Area 51, etc <img src=../images/dmxzone/forum/icon_smile_wink.gif border=0 align=middle> )
I am also missing Latitude/Longitude readings for 153 non-military Zips, so it's not quite the complete set.
Yet <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>
I am also missing Latitude/Longitude readings for 153 non-military Zips, so it's not quite the complete set.
Yet <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>
Replied 19 Mar 2005 23:39:23
19 Mar 2005 23:39:23 Chris Charlton replied:
I got booted out of Area 51... for playing Dodgeball with the martians. Cheating bastards anyway, make me see double with their mind control! Haha.
Back on subject: awesome! Can't wait. Unfortunately I don't know where to grab the lat./long. for any zip code - never looked for that info.
~ ~ ~ ~ ~ ~ ~
Chris Charlton <i>- DMXzone Manager</i>
<font size=1>[ Studio MX/MX2004 | PHP/ASP | SQL | XHTML/CSS | XML | Actionscript | Web Accessibility | MX Extensibility ]</font id=size1>
Back on subject: awesome! Can't wait. Unfortunately I don't know where to grab the lat./long. for any zip code - never looked for that info.
~ ~ ~ ~ ~ ~ ~
Chris Charlton <i>- DMXzone Manager</i>
<font size=1>[ Studio MX/MX2004 | PHP/ASP | SQL | XHTML/CSS | XML | Actionscript | Web Accessibility | MX Extensibility ]</font id=size1>
Replied 20 Mar 2005 00:01:57
20 Mar 2005 00:01:57 Andrew Scott replied:
Try this:
www.housepound.co.uk/postcodes/test2.asp
I'll do all the final polishing (Actual Distance, order, etc.) tomorrow if I can find the time.
www.housepound.co.uk/postcodes/test2.asp
I'll do all the final polishing (Actual Distance, order, etc.) tomorrow if I can find the time.
Replied 21 Mar 2005 09:37:52
21 Mar 2005 09:37:52 Chris Charlton replied:
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>Try this: www.housepound.co.uk/postcodes/test2.asp<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
OMG! That so rocks!!! You must (please) share! Did I mention "please"?! <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>
~ ~ ~ ~ ~ ~ ~
Chris Charlton <i>- DMXzone Manager</i>
<font size=1>[ Studio MX/MX2004 | PHP/ASP | SQL | XHTML/CSS | XML | Actionscript | Web Accessibility | MX Extensibility ]</font id=size1>
OMG! That so rocks!!! You must (please) share! Did I mention "please"?! <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>
~ ~ ~ ~ ~ ~ ~
Chris Charlton <i>- DMXzone Manager</i>
<font size=1>[ Studio MX/MX2004 | PHP/ASP | SQL | XHTML/CSS | XML | Actionscript | Web Accessibility | MX Extensibility ]</font id=size1>
Replied 22 Mar 2005 01:14:12
22 Mar 2005 01:14:12 Simon Martin replied:
Hell yeah - this is one of those things that I've <i>always</i> wanted to know how to do, or have a lump of code that I can use again and again.
Andrew if you could write this up for the zone that would be totally awesome!
Live the life you love
Love the life you live
~ ~ ~ ~ ~ ~ ~
<b>Simon Martin</b> - <i>DMXzone Manager</i>
<font size=1>[ Dreamweaver MX/MX2004 | ASP | SQL | XHTML/CSS | Web Accessibility ] </font id=size1>
Andrew if you could write this up for the zone that would be totally awesome!
Live the life you love
Love the life you live
~ ~ ~ ~ ~ ~ ~
<b>Simon Martin</b> - <i>DMXzone Manager</i>
<font size=1>[ Dreamweaver MX/MX2004 | ASP | SQL | XHTML/CSS | Web Accessibility ] </font id=size1>
Replied 24 Mar 2005 18:45:00
24 Mar 2005 18:45:00 Simon Martin replied:
Just looking back on this post... Its like the new star wars thing... the waiting is killing me!
Live the life you love
Love the life you live
~ ~ ~ ~ ~ ~ ~
<b>Simon Martin</b> - <i>DMXzone Manager</i>
<font size=1>[ Dreamweaver MX/MX2004 | ASP | SQL | XHTML/CSS | Web Accessibility ] </font id=size1>
Live the life you love
Love the life you live
~ ~ ~ ~ ~ ~ ~
<b>Simon Martin</b> - <i>DMXzone Manager</i>
<font size=1>[ Dreamweaver MX/MX2004 | ASP | SQL | XHTML/CSS | Web Accessibility ] </font id=size1>
Replied 24 Mar 2005 19:24:37
24 Mar 2005 19:24:37 Chris Charlton replied:
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>Just looking back on this post... Its like the new star wars thing... the waiting is killing me!<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
"...some consider to be unnatural.
Is it possible to learn this power?
Not from a Jedi!"
~ ~ ~ ~ ~ ~ ~
Chris Charlton <i>- DMXzone Manager</i>
<font size=1>[ Studio MX/MX2004 | PHP/ASP | SQL | XHTML/CSS | XML | Actionscript | Web Accessibility | MX Extensibility ]</font id=size1>
"...some consider to be unnatural.
Is it possible to learn this power?
Not from a Jedi!"
~ ~ ~ ~ ~ ~ ~
Chris Charlton <i>- DMXzone Manager</i>
<font size=1>[ Studio MX/MX2004 | PHP/ASP | SQL | XHTML/CSS | XML | Actionscript | Web Accessibility | MX Extensibility ]</font id=size1>
Replied 28 Mar 2005 11:10:07
28 Mar 2005 11:10:07 Andrew Scott replied:
Folks,
Had a bit of a nasty accident recently - came off my bike and caused a fair bit of damage (fractured skull, shattered kneecap, severed tendons, blah, blah, blah). So I haven't really been up to doing a great deal on this subject for a while.
All I can say at the moment is hang in there and I will deal with this topic fully and properly.
Thanks for the patience.
Had a bit of a nasty accident recently - came off my bike and caused a fair bit of damage (fractured skull, shattered kneecap, severed tendons, blah, blah, blah). So I haven't really been up to doing a great deal on this subject for a while.
All I can say at the moment is hang in there and I will deal with this topic fully and properly.
Thanks for the patience.
Replied 28 Mar 2005 17:58:37
28 Mar 2005 17:58:37 Chris Charlton replied:
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>Had a bit of a nasty accident recently - came off my bike and caused a fair bit of damage (fractured skull, shattered kneecap, severed tendons, blah, blah, blah). So I haven't really been up to doing a great deal on this subject for a while.
All I can say at the moment is hang in there and I will deal with this topic fully and properly.<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
OMG, WTF!!!?!?!??!? How did you even <i>type</i> this note?! Please, get better.
~ ~ ~ ~ ~ ~ ~
Chris Charlton <i>- DMXzone Manager</i>
<font size=1>[ Studio MX/MX2004 | PHP/ASP | SQL | XHTML/CSS | XML | Actionscript | Web Accessibility | MX Extensibility ]</font id=size1>
All I can say at the moment is hang in there and I will deal with this topic fully and properly.<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
OMG, WTF!!!?!?!??!? How did you even <i>type</i> this note?! Please, get better.
~ ~ ~ ~ ~ ~ ~
Chris Charlton <i>- DMXzone Manager</i>
<font size=1>[ Studio MX/MX2004 | PHP/ASP | SQL | XHTML/CSS | XML | Actionscript | Web Accessibility | MX Extensibility ]</font id=size1>
Replied 17 Apr 2005 01:03:20
17 Apr 2005 01:03:20 matt egginton replied:
Lots of people seem to need to do this. Im working on a solution myself. Currently I can type in a postcode and radius in miles and receive a list of postcodes that fall into the radius.
I want to make an SQL statment that selects all postcodes WHERE postcode= the array of postcodes that I just got.
problems i have at the moment are :
I have stored 6 digit postcodes, but my postcode data is only 4 digits (problem with WHERE clause)
I have no idea how to structure the where clause, and output my array of postcodes within the radius into it.
Im not even sure if the way im doing it is the most logical. Any hints or tips are appreciated, I have got this far from forums, long nights and other peoples code!
If i can get this sorted i will post the code here to help others. <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>
I want to make an SQL statment that selects all postcodes WHERE postcode= the array of postcodes that I just got.
problems i have at the moment are :
I have stored 6 digit postcodes, but my postcode data is only 4 digits (problem with WHERE clause)
I have no idea how to structure the where clause, and output my array of postcodes within the radius into it.
Im not even sure if the way im doing it is the most logical. Any hints or tips are appreciated, I have got this far from forums, long nights and other peoples code!
If i can get this sorted i will post the code here to help others. <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>
Replied 19 Apr 2005 19:05:18
19 Apr 2005 19:05:18 matt egginton replied:
never mind i have it working now.
Replied 19 Apr 2005 19:37:12
19 Apr 2005 19:37:12 Chris Charlton replied:
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote> Had a bit of a nasty accident recently - came off my bike and caused a fair bit of damage (fractured skull, shattered kneecap, severed tendons, blah, blah, blah). So I haven't really been up to doing a great deal on this subject for a while.
All I can say at the moment is hang in there and I will deal with this topic fully and properly.
Thanks for the patience.<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
Hope all is well!
~ ~ ~ ~ ~ ~ ~
Chris Charlton <i>- DMXzone Manager</i>
<font size=1>[ Studio MX/MX2004 | PHP/ASP | SQL | XHTML/CSS | XML | Actionscript | Web Accessibility | MX Extensibility ]</font id=size1>
All I can say at the moment is hang in there and I will deal with this topic fully and properly.
Thanks for the patience.<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
Hope all is well!
~ ~ ~ ~ ~ ~ ~
Chris Charlton <i>- DMXzone Manager</i>
<font size=1>[ Studio MX/MX2004 | PHP/ASP | SQL | XHTML/CSS | XML | Actionscript | Web Accessibility | MX Extensibility ]</font id=size1>
Replied 11 Dec 2005 21:06:23
11 Dec 2005 21:06:23 Andrew Scott replied:
Hi folks.
After a somewhat self-indulgent extended period of recuperation, I thought I should turn my attention once more to this subject. If anyone's still interested in this, let me know and I'll post up some code.
After a somewhat self-indulgent extended period of recuperation, I thought I should turn my attention once more to this subject. If anyone's still interested in this, let me know and I'll post up some code.
Replied 20 Dec 2005 21:10:00
20 Dec 2005 21:10:00 Dave Thomas replied:
post away m8 <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle> i'll gladly take it.
regards
Dave Thomas
<b>DMX Zone Manager</b>
regards
Dave Thomas
<b>DMX Zone Manager</b>
Replied 29 Dec 2005 00:21:22
29 Dec 2005 00:21:22 Jamie Nicol replied:
.
Edited by - wicksee on 29 Dec 2005 14:46:53
Edited by - wicksee on 29 Dec 2005 14:46:53