I've created a table with MySQL called name, and this table has many rows but only 3 fields (name, coordinate1, coordinate2) each with their own data. I'm trying to Query this table (name) so that any results will be written to a text file. I'm not sure if Dataset Loop is needed for this or not.
I've successfully created an SQL Query with Connection String:
Code: Select all
Provider=MSDASQL.1;Persist Security Info=False;Extended Properties="DSN=Main;DESCRIPTION=Main Coordinates List;SERVER=localhost;UID=root;DATABASE=names;PORT=3306"
Code: Select all
SELECT name, ( 6371 * acos( cos( radians(45.0843184) ) * cos( radians( coordinate1 ) )
* cos( radians( coordinate2 ) - radians(-64.398319) ) + sin( radians(45.0843184) ) * sin(radians(coordinate1)) ) ) AS distance
FROM name
HAVING distance < 25
ORDER BY distance
LIMIT 0 , 20;
Thank you