MySQL Forums
Forum List  »  Newbie

SQL Query not returning results
Posted by: Russell Lambert
Date: July 13, 2005 08:09AM

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

Options: ReplyQuote


Subject
Written By
Posted
SQL Query not returning results
July 13, 2005 08:09AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.