Jump to content


Photo

Sql query that doesnt work tryign to use between two values


  • Please log in to reply
1 reply to this topic

#1 DanielStead

DanielStead
  • Members
  • Pip
  • Newbie
  • 6 posts

Posted 02 December 2005 - 03:52 PM

Here is the sql statement

SELECT ParcelID, x, y
FROM Polygons
WHERE Parish = '{Stadhampton}'
AND ParcelID = 91
AND x BETWEEN 460000 AND 460500
AND y BETWEEN 199000 AND 199500;

Not really too sure bout the between statements as the query worked fine why i didnt use between anyone any ideas as i have never used between before


#2 Honoré

Honoré
  • Members
  • PipPipPip
  • Advanced Member
  • 66 posts
  • LocationAntwerp - Belgium

Posted 02 December 2005 - 04:25 PM

[!--quoteo(post=323926:date=Dec 2 2005, 05:52 PM:name=DanielStead)--][div class=\'quotetop\']QUOTE(DanielStead @ Dec 2 2005, 05:52 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
SELECT ParcelID, x, y
FROM Polygons
WHERE Parish = '{Stadhampton}'
AND ParcelID = 91
AND x BETWEEN 460000 AND 460500
AND y BETWEEN 199000 AND 199500;
[/quote]
try
SELECT ParcelID, x, y
FROM Polygons
WHERE Parish = '{Stadhampton}'
AND ParcelID = 91
AND (x BETWEEN 460000 AND 460500)
AND (y BETWEEN 199000 AND 199500);





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users