Article View: borland.public.interbase.sql
Article #11309Re: LIKE command with NUMERIC field?
From: Kevin Naidoo
Date: Wed, 27 Nov 2002 13:05
Date: Wed, 27 Nov 2002 13:05
68 lines
2708 bytes
2708 bytes
Tried the CAST, it still requires the space in front... I'm using IB6.5 Dialect 1 (and you?)... Have tried it on two different databases on two different machines with the same results... Quite odd... Regards, Kevin "Martijn Tonies" <m.tonies@upscene_remove.com> wrote in message news:3de4c04c@newsgroups.borland.com... > Hi, > > What if you CAST it to VARCHAR first? > > WHERE CAST(mynumericfield AS VARCHAR(10)) LIKE '10%' > > > Actually, upon testing, it works fine with a database I have... ?! > > select * from BESTELLING > where bestellingid like '111%' > > Returns rows alright... > -- > > With regards, > > Martijn Tonies > InterBase Workbench - the developer tool for InterBase > http://www.upscene.com > > > Upscene Productions > http://www.upscene.com > > "This is an object-oriented system. > If we change anything, the users object." > > > A few questions about LIKE and NUMERIC fields :- > > > > 1) We currently use LIKE with some of our NUMERIC fields. I know this is not > > how it should be used, so can anyone give a method to do such comparisons > > with NUMERIC fields? I need to be able to find NUMERICs starting with say 10 > > (like 10, 101, 10201 etc.). > > > > 2) This used to work fine with IB 5.6. I've just upgraded to IB 6.5 and now > > the problem seems to be that I need to include a space in front of the value > > I'm looking for. eg. LIKE ' 10%' (LIKE '10%' worked fine in IB5.6). Negative > > values work fine eg. LIKE '-10%'. Any ideas about this? (I tried a LIKE > > '+10%' to no avail.) > > > > Hope my questions make sense. > > > > Regards, > > Kevin Naidoo > > M.Ying and Associates > > > > > >
Technical Details
Message-ID:
<3de4c26b@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!nntp2.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<3de4b7fe@newsgroups.borland.com> <3de4c04c@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 114a0e,9a9504f897cb3591 X-Google-Attributes: gid114a0e,public X-Google-ArrivalTime: 2002-11-27 05:06:17 PST From: "Kevin Naidoo" <kev@mysoft.co.za> Newsgroups: borland.public.interbase.sql References: <3de4b7fe@newsgroups.borland.com> <3de4c04c@newsgroups.borland.com> Subject: Re: LIKE command with NUMERIC field? Date: Wed, 27 Nov 2002 15:05:16 +0200 Lines: 70 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 NNTP-Posting-Host: 66.8.38.180 Message-ID: <3de4c26b@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1038402155 66.8.38.180 (27 Nov 2002 05:02:35 -0800) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!nntp2.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail