Re: Quick SQL Question

Steve Abaffy <[email protected]>
Newsgroups gmane.comp.windows.devel.dotnet.winforms
Message-ID <029a01c7972d$b622e090$2268a1b0$@biz>
Yes this is MS SQL Server, version SQL 2000, Not sure what you mean by How
am I executing the query? I have a stored procedure

The SQL statement from the stored procedure is below:
Where #tbl1 is a list of all address in the zipcode provided.


select
Zipcode,StreetPreDirection,StreetName,StreetSuffix,StreetPostDirection,Addre
ssLow,
AddressHigh,OddEven,SecondAbbrev,SecondLowNo,SecondHighNo,SecondOddEven,
Zip4  into #tbl2 from #tbl1 where SoundEx(streetname) = SoundEx(@streetname)
and @PAddress between AddressLow and AddressHigh
and OddEven in ('B',@OddEven)
and SecondHighNo IS NULL

-----Original Message-----
From: Discussion forum for developers using Windows Forms to build apps and
controls [mailto:[email protected]] On Behalf Of Booth,
Bill
Sent: Tuesday, May 15, 2007 3:09 PM
To: [email protected]
Subject: Re: [DOTNET-WINFORMS] Quick SQL Question

Is this MS SQL Server and what version? How are you executing the query?


-----Original Message-----
From: Discussion forum for developers using Windows Forms to build apps
and controls [mailto:[email protected]] On Behalf Of
Steve Abaffy
Sent: Tuesday, May 15, 2007 14:59
To: [email protected]
Subject: [DOTNET-WINFORMS] Quick SQL Question

Hello,

        I am writing an application that looks up addresses. The data is
broken up into prestreetdirection, streetname, poststreetdirection,
suffix, lowaddress and highaddress. All these fields are char fields as
we have lowaddress "numbers" like 312B or 31-A etc...
I have a query that basically has in its where clause,
        Where @SuppliedHouseNumber between LowAddress and HighAddress

For the value of @SuppliedHouseNumber='700' the query returns the
following two records
1) LowAddress = 700 , highAddress = 700 which of course is expected,
2) LowAddress = 700 , highAddress = 718 which of course is NOT Expected
but I don't know why.

Any ideas and also how to get around the other problem of
SuppliedHouseAddress = 123 and returns like 1123?

Thanks

The information in this e-mail is confidential, may be legally privileged
and is intended solely for the addressee. If you have received this e-mail
in error, you are hereby notified that any use, distribution, or copying of
this communication is strictly prohibited.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.