06-11-2012 02:41 PM
06-11-2012 04:32 PM
First of all, you would have to have the Lat and Long for your Source Location (or Postal Code).
From there on, it would depend on how you want your Zone to be configured. A Simple attempt would be to create a Rectangular zone. In this case, you just have to find 4 coordinates and query for all records that lie within those for coordiates.
So, for example, given a point, you calculate the 4 corners of a Square that are X number of Miles away. Then just build a Select statement for any records that lies within that zone.
Now, if you are looking for a true "within X Miles" circular radius, then you would have to check every record in the DB and see if it is within the Distance to your Point.
I do have a set of SQL functions to determine Distance on Miles or Kilometers. You will however have to create Dynamic SQL Statements to retreive the data including your Comparisson Point.
At the bottom of my document there are some sample ussages of the functions.
06-12-2012 12:28 AM