Re: Quick SQL Question
Stacey Levine <[email protected]>
| Newsgroups | gmane.comp.windows.devel.dotnet.winforms |
|---|---|
| Message-ID | <A48E95FB3D4D02449554AE952F3B3E470445F427@vmcexchng.www.musicforasong.net> |
If you addresses can contain letters, then you are going to have problems. You would be better to break apart the numbers from the letters. You could do that in a view on the table but it will slow it down. -----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 3:59 PM 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