🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.ado
Article #1656

Re: strange problem with ADOTable filter...

#1656
From: Richard Plokhaar
Date: Tue, 09 Mar 2004 21:23
112 lines
4922 bytes
aarghh.... too late to work... :-(

in table:
start period 14.12.2003, end period 11.12.2004, record should show up.
start period 14.12.2003, end period 05.01.2004, record should show up.
start period 05.01.2004, end period 11.12.2004, record should show up.
start period 05.01.2004, end period 10.01.2004, record should show up.
changed line:
start period 14.12.2003, end period 31.12.2003, record should NOT show up.
start period 25.01.2004, end period 11.12.2004, record should NOT show up.



"Richard Plokhaar" <richardplokhaar@hotmail.com> schrieb im Newsbeitrag
news:404e33fa$1@newsgroups.borland.com...
> and a nice typo of course...
>
>  in table:
>  start period 14.12.2003, end period 11.12.2004, record should show up.
>  start period 14.12.2003, end period 05.01.2004, record should show up.
>  start period 05.01.2004, end period 11.12.2004, record should show up.
>  start period 05.01.2004, end period 10.01.2004, record should show up.
>  start period 14.12.2003, end period 31.12.2004, record should NOT show
up.
> <- changed line...
>  start period 25.01.2004, end period 11.12.2004, record should NOT show
up.
>
>
> "Richard Plokhaar" <richardplokhaar@hotmail.com> schrieb im Newsbeitrag
> news:404e31aa@newsgroups.borland.com...
> > Hi, can somebody help me on a tiny problem?
> >
> > I have following problem:
> > I have a table with a PrintOut option (text) and a "start of period" and
> > "end of period".
> > the filter should show all records that have the right PrintOut field
> string
> > and are within the period.
> >
> > Example: user period = 01.01.2004 until 20.01.2004
> >
> > in table:
> > start period 14.12.2003, end period 11.12.2004, record should show up.
> > start period 14.12.2003, end period 05.01.2004, record should show up.
> > start period 05.01.2004, end period 11.12.2004, record should show up.
> > start period 05.01.2004, end period 10.01.2004, record should show up.
> > start period 14.12.2003, end period 11.12.2004, record should NOT show
up.
> > start period 25.01.2004, end period 11.12.2004, record should NOT show
up.
> >
> > in this example various pointers have been replaced to make it more
> generic
> > readable:
> >
> > -----------------------------------------------
> > AnsiString a="01.01.2004";
> > AnsiString e="20.01.2004";
> > AnsiString text;
> >
> > ADOTable1->Filtered=false;
> >
> > text="( PrintOut = "+QuotedStr("SomeText");
> >
> > text+=" ) AND ( ( Periode_start >= '" +StrToDate(a)+"'";
> > text+=" AND Periode_end <= '" +StrToDate(e)+"' )";
> >
> > text+=" OR ( Periode_start <= '" +StrToDate(a)+"'";
> > text+=" AND Periode_end >= '" +StrToDate(e)+"' )";
> >
> > text+=" OR ( Periode_end >= '" +StrToDate(a)+"'";
> > text+=" AND Periode_end <= '" +StrToDate(e)+"' )";
> >
> > text+=" OR ( Periode_start >= '" +StrToDate(a)+"'";
> > text+=" AND Periode_start <= '" +StrToDate(e)+"' ) )";
> >
> > ADOTable1->Filter=text;
> >
> > ADOTable1->Filtered=true;
> > --------------------------------------------------------
> >
> > so basically it is a () AND (  (()AND()) OR (()AND()) OR (() AND ())  )
> >
> > if I write it as () AND () AND () OR () AND () OR () AND () it is
working
> > right for the dates (which makes sense, but is wrong coded)
> > if I write it as () AND (() AND () OR () AND () OR () AND ()) cpp
builder
> > starts to moan around that values are invalid...
> > Can't the filter handle the nested brackets?
> >
> > how to solve it?
> >
> >
> >
> > -- 
> > SIGNALSOFT Rail Consultancy Ltd.
> > Richard Plokhaar
> > 24 Park Road
> > Godalming
> > Surrey
> > GU7 1SH
> > United Kingdom
> > Tel: 00 44 1483 861 320
> > Mobile: 00 44 7867 503 908
> > Email: signalsoft@tiscali.co.uk
> > Private: Plokhaar@tiscali.co.uk
> >
> >
>
>
Technical Details
Message-ID: <404e35c7$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.yul.equant.net!c03.atl99!news.usenetserver.com!news02.tsnz.net!newsfeed01.tsnz.net!ken-transit.news.telstra.net!lon-in.news.telstra.net!news.telstra.net!mws-stat-syd.cdn.telstra.com.au!newsx!newsgroups.borland.com!not-for-mail
References: <404e31aa@newsgroups.borland.com> <404e33fa$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10698b,73b08d1388cffd8a
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2004-03-09 13:40:20 PST
From: "Richard Plokhaar" <richardplokhaar@hotmail.com>
Newsgroups: borland.public.cppbuilder.database.ado
References: <404e31aa@newsgroups.borland.com> <404e33fa$1@newsgroups.borland.com>
Subject: Re: strange problem with ADOTable filter...
Date: Tue, 9 Mar 2004 21:23:18 -0000
Lines: 114
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 80.42.94.6
Message-ID: <404e35c7$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1078867399 80.42.94.6 (9 Mar 2004 13:23:19 -0800)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.yul.equant.net!c03.atl99!news.usenetserver.com!news02.tsnz.net!newsfeed01.tsnz.net!ken-transit.news.telstra.net!lon-in.news.telstra.net!news.telstra.net!mws-stat-syd.cdn.telstra.com.au!newsx!newsgroups.borland.com!not-for-mail