SQL Query not returning results
Hi all,
I've been working on a search distance by postcode script which was originally for access, ive tried it using access and it works fine, however i need it to work in mySQL, but i can't get it to work for the life of me.
the code in the original asp script is below:
"SELECT * FROM postcode WHERE longitude BETWEEN " + Replace(rsDistance__long1, "'", "''") + " + " + Replace(rsDistance__dist, "'", "''") + " AND " + Replace(rsDistance__long1, "'", "''") + " - " + Replace(rsDistance__dist, "'", "''") + " AND latitude BETWEEN " + Replace(rsDistance__lat1, "'", "''") + " + " + Replace(rsDistance__dist, "'", "''") + " AND " + Replace(rsDistance__lat1, "'", "''") + " - " + Replace(rsDistance__dist, "'", "''") + ""
I've Done a response.write on the query on that statement which returns this result:
SELECT * FROM postcode WHERE longitude BETWEEN -1.868 + 0.5 AND -1.868 - 0.5 AND latitude BETWEEN 52.903 + 0.5 AND 52.903 - 0.5
However, when run, it doesn't produce any results when i know it should.
I've run the statement in the console of DBmanger to see what it brings up and it doesn't show any records when it should do.
is there something in there which isn't compatible with mysql? as the code does work with access.
Thanks
Russ