I did this once. It's pretty easy. The trick was to find a
table that related zip codes to coordinates (longitude &
latitude). Then I found a formula on the net that calculates
distances between two points on the globe. My query then
found the distance between the base zip code an all other
zip codes, and filtered out the ones that were too far.
I did a few things to make the query less expensive,
such as converting the latitude and longitude to radians,
and only searching on zip codes that actually contained
a match. Believe it or not, it worked in Access.
Patrick
> -----Original Message-----
> From: John Quarto-vonTivadar [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, May 02, 2001 2:48 PM
> To: Fusebox
> Subject: Re: Matches at ComputerDatingUSA.COM
>
>
> >
> > I tried to put a match as being united states and it returned 0 entries.
> > This of course includes my wife not being returned.
> >
>
> hmm, when I put mine in, I got only one match -- Michael's wife! :) Oh
> well, that great catch is already taken.
>
> hey Marc, a question on how you're doing the mileage search. Is
> it based on
> ZIP? if so, are you doing a lookup to a ZIPs table for my ZIP
> within X miles
> of any ZIP in that table and then using those results as a filter on the
> dating search? if so, how do you stop a large number of nearest ZIP's (in
> your comment you mentioned "try putting in within 8000 miles of me") from
> resulting a huge-ass query like:
>
> Select PersonID as MyMatchID From Persons where ZIP IN (10001,
> 10002, 10003,
> .....[up to thousands of ZIP codes])
>
>
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists