Subject | RE: [IBO] how to work with filters? |
---|---|
Author | Craig Leonardi |
Post date | 2013-07-02T19:12:22Z |
There are several ways to do this.
Here is yet another using TIB_Query.SQLWhereItems
It is very, very fast.
quOffList: TIB_Query;
cbOffFilter: TComboBox;
procedure TfrmDocOffList.cbOffFilterChange(Sender: TObject);
begin
with quOffList do
begin
InvalidateSQL;
Refresh;
end;
end;
procedure TfrmDocOffList.quOffListPrepareSQL(Sender: TIB_Statement);
begin
with quOffList.SQLWhereItems do
begin
Clear;
case cbOffFilter.ItemIndex of
0: Add('OFFICE.STATUS = ' + QuotedStr('A'));
1: Add('OFFICE.STATUS = ' + QuotedStr('I'));
end;
end;
end;
Hope this helps!
From: IBObjects@yahoogroups.com [mailto:IBObjects@yahoogroups.com] On Behalf Of Alexandre
Sent: Tuesday, July 02, 2013 12:53 PM
To: IBObjects@yahoogroups.com
Subject: [IBO] how to work with filters?
Hi Guys,
Well, I have a checkbox in my project and I need to filter some records when the checkbox is checked.
Something like this:
Checked: select * from mytable where status=0
Not checked: select * from mytable
How can I do this using TIBOQuery with filters?
Thanks for some help.
Alexandre
[Non-text portions of this message have been removed]
[Non-text portions of this message have been removed]
Here is yet another using TIB_Query.SQLWhereItems
It is very, very fast.
quOffList: TIB_Query;
cbOffFilter: TComboBox;
procedure TfrmDocOffList.cbOffFilterChange(Sender: TObject);
begin
with quOffList do
begin
InvalidateSQL;
Refresh;
end;
end;
procedure TfrmDocOffList.quOffListPrepareSQL(Sender: TIB_Statement);
begin
with quOffList.SQLWhereItems do
begin
Clear;
case cbOffFilter.ItemIndex of
0: Add('OFFICE.STATUS = ' + QuotedStr('A'));
1: Add('OFFICE.STATUS = ' + QuotedStr('I'));
end;
end;
end;
Hope this helps!
From: IBObjects@yahoogroups.com [mailto:IBObjects@yahoogroups.com] On Behalf Of Alexandre
Sent: Tuesday, July 02, 2013 12:53 PM
To: IBObjects@yahoogroups.com
Subject: [IBO] how to work with filters?
Hi Guys,
Well, I have a checkbox in my project and I need to filter some records when the checkbox is checked.
Something like this:
Checked: select * from mytable where status=0
Not checked: select * from mytable
How can I do this using TIBOQuery with filters?
Thanks for some help.
Alexandre
[Non-text portions of this message have been removed]
[Non-text portions of this message have been removed]