sql server - SQL between clause returns rows for values outside bounds -
as title says when use sql between clause running against address range low high , putting in number outside of 2 , getting rows returned me. , know why.
http://www.sqlfiddle.com/#!6/49467/2
quick hit on query, using address number of 4929
, getting rows returned me address range low , high numbers 400
, 498
respectively.
here query:
select zipcodelow , zipcodehigh , zipextensionlow , endingeffectivedate , beginningeffectivedate , addressrangelow , addressrangehigh , streetname , city , zipcode , zip4, zip4high boundtable ('68503' between zipcodelow , zipcodehigh) , ('4929' between [addressrangelow] , [addressrangehigh]) , ([streetname] = '32nd') , (getdate() between [beginningeffectivedate] , [endingeffectivedate])
convert 4929 numeric first , run query:
select zipcodelow , zipcodehigh , zipextensionlow , endingeffectivedate , beginningeffectivedate , addressrangelow , addressrangehigh , streetname , city , zipcode , zip4, zip4high boundtable ('68503' between zipcodelow , zipcodehigh) , (convert(numeric,'4929') between [addressrangelow] , [addressrangehigh]) , ([streetname] = '32nd') , (getdate() between [beginningeffectivedate] , [endingeffectivedate])
Comments
Post a Comment