1 Reply Latest reply on Oct 30, 2006 11:18 AM by dave.cozens

    Help with a query

    GiambattistaScivoletto
      I have a function that calculate the distance between two geographic points.

      Giving a point1 (latitude1, longitude1), with this query I want to select all other points from a database near it:

      <cfquery name="listofpoints" datasource="points">
      select pointname, latitude, longitude from points where
      #distance(latitude1, longitude1, latitudine, longitudine)# < 10
      </cfquery>

      I'm not the best with SQL ... I know this query is not right, could you help me ? I would like also return the points orderedt from the nearest to the farest (is it right "farest"? ... I mean the opposite of nearest).