Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Calculate Postal Codes

Author  Topic 

fawadafr
Starting Member

47 Posts

Posted - 2010-06-03 : 14:18:24
I have been trying to write SQL statement to find list of postal codes that are in 20 mile radius of the origin by using longitude and latitude for each postal code.

In my database, I do have the latitude and longitude associated for each postal code.

Sample SQL statement:

SELECT [Counter]
,[PostalCode]
,[StateCode]
,[County]
,[City]
,[PostalCodeType]
,[Address]
,[State]
,[Latitude]
,[Longitude]
FROM [SystemPostalCode]
GO


Thank you,

--
Fawad Rashidi
Web Developer
www.fawadafr.com

Sachin.Nand

2937 Posts

Posted - 2010-06-03 : 14:40:13
This link can be useful.

http://blogs.lessthandot.com/index.php/DataMgmt/DataDesign/sql-server-zipcode-latitude-longitude-pr

PBUH
Go to Top of Page

fawadafr
Starting Member

47 Posts

Posted - 2010-06-04 : 00:09:38
Thank you Idera. I also found this page earlier today and was able to complete the job.

--
Fawad Rashidi
Web Developer
www.fawadafr.com
Go to Top of Page
   

- Advertisement -