sql/asp question

1. Junior Member
Join Date
Dec 1969
Posts
6

## sql/asp question

I&#039;ve found some examples of calculating zip code distances, but I&#039;m trying to figure out how I could then display each distance. Anyone point me to an example?<BR><BR>here is the calulation for finding the distance:<BR><BR>SELECT ZIP_CODE FROM zip "& _<BR> "WHERE @radius &#062; 3959 * ATN( SQR(1 - (SIN(@lat/ 57.3) * SIN(LAT/ 57.3) + " & _<BR> "COS(@lat/ 57.3) * COS(LAT/ 57.3) * " & _<BR> "COS((LNG/ 57.3) - (@lng/ 57.3))) ^2 ) /" & _<BR> "(SIN(@lat/ 57.3) * SIN(LAT/ 57.3) + " & _<BR> "COS(@lat/ 57.3) * COS(LAT/ 57.3) * " & _<BR> "COS((LNG/ 57.3) - (@lng/ 57.3))) ) ) " & _<BR> "ORDER BY name"

2. Senior Member
Join Date
Dec 1969
Posts
2,854

## RE: sql/asp question

SELECT @radius, name, ZIP_CODE FROM zip "& _ <BR> "WHERE @radius &#062; 3959 * ATN( SQR(1 - (SIN(@lat/ 57.3) * SIN(LAT/ 57.3) + " & _ <BR> "COS(@lat/ 57.3) * COS(LAT/ 57.3) * " & _ <BR> "COS((LNG/ 57.3) - (@lng/ 57.3))) ^2 ) /" & _ <BR> "(SIN(@lat/ 57.3) * SIN(LAT/ 57.3) + " & _ <BR> "COS(@lat/ 57.3) * COS(LAT/ 57.3) * " & _ <BR> "COS((LNG/ 57.3) - (@lng/ 57.3))) ) ) " & _ <BR> "ORDER BY name"

3. Junior Member
Join Date
Dec 1969
Posts
6

## not applicable

I would have to already know the distance and it be stored for that query to work. A caluculation is going to be necessary I think.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•