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

zip code proximity search

Status
Not open for further replies.

kristinac13

Programmer
Dec 22, 2005
27
US
I am trying to create a search page for users to search for our affiliates based on their zip code. I want to retrieve all affiliates within a 50 mile radius. I have looked all over the web and must admit I have no idea where to even start. I've seen everything but an idea of how to do it in VB6. Has anyone written a search like this or could anyone give me an idea where to start?
 
Okay things are trying to work. My new issue is dealing with the extra four digits some of my affiliate addresses have attached. The zips table has no extra 4 but my affiliates table does. Is there a way to address these extra digits?
 
Change the way you are joining the tables.

I showed an example like this...

Select Field1, Field2, Etc
From Affiliates
Inner Join #Zips On Affiliates.ZipCode = #Zips.ZipCode

Instead, use this...

Code:
Select Field1, Field2, Etc
From   Affiliates
       Inner Join #Zips On [red]Left([/red]Affiliates.ZipCode[red],5)[/red] = #Zips.ZipCode

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top