Navaidstech Level: Trainee
 Registered: 25-11-2008 Posts: 1
|
Question about populating MSFlexGrid
Hi all... I'm just getting into database programming. Find it much easier than accessing large random data files. However I have a question about SQL query that I can't get to do what I want it to do.
Let me simplify it by assuming a database with three fields - City Name, Longitude, Latitude.
I'm trying to create a query that will populate an MSFlexGrid control with only those cities that start with a certain letter AND are a certain distance from a given location.
I realize that I could introduce an extra field in the database that will contain the actual distances to these cities and be done with it but the problem here is that the central location is not fixed (ie. a moving car). So in essence I have to extract the lat/lon from the database, calculate the distance, then apply the city name filter and then populate the MSFlexGrid...
I was playing around with "Select * FROM xxx WHERE..." type query and it almost does what I want it to do, but can I apply an externally calculated distance filter to it?
Any help would be greatly appreciated.
thanks
____________________________
Alex
|