Subject | RE: [IBO] Adding search criteria to WHERE clause and more..not working as expected. |
---|---|
Author | Jason Wharton |
Post date | 2007-01-13T19:35:20Z |
SQLWhereItems should only be accessed during the OnPrepareSQL event.
You can set a filter after the call to AssignSQLWithSearch() and that would
do it.
Jason
You can set a filter after the call to AssignSQLWithSearch() and that would
do it.
Jason
> -----Original Message-----
> From: IBObjects@yahoogroups.com [mailto:IBObjects@yahoogroups.com]On
> Behalf Of Adrian Wreyford
> Sent: Saturday, January 13, 2007 7:48 AM
> To: IBObjects@yahoogroups.com
> Subject: [IBO] Adding search criteria to WHERE clause and more..not
> working as expected.
>
>
> Well I asked a similar question a week ago, and no answer. But today I
> stumbled on something I think is the answer, but cannot get
> ti to work.
>
>
>
> I want to assign Search criteria to a report Query, then add
> a between dates
> clause for Date OF Birth field to the where clause, and then
> run the report.
>
>
>
> I thought the following would do, but the add items, doesn't
> appear to add
> the item:
>
> I put the dataset into prepare state; must be missing something here?
>
>
>
> IBOQuery1.Prepare;
>
> IBOQuery1.AssignSQLWithSearch(IB_Query1);
>
> IBOQuery1.SQLWhereItems.Add('ANIMAL.ANIMALDOB BETWEEN ''' +
> DateToStr(DTPBeg.Date) + ''' AND ''' +
> DateToStr(DTPEnd.Date) + ''' ');
>
> IBOQuery1.Open;
>
>
>
> The IBOQuery1.SQLWhere then only contains the assigned search
> criteria, and
> not the line added using the SQLWhereItemsAdd, and the report has the
> incorrect rows.
>
>
>
> Any help will be appreciated.
>
>
>
> Regards
>
>
>
> Adrian
>