FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Recordset filter question
Posts: 1195
Joined: Mon Oct 17, 2005 05:41 AM
Recordset filter question
Posted: Fri Aug 10, 2018 10:12 AM

Hello,

I have a problem with the filter on a recordset. I already found on the SQL-sites that there ale problems with AND and OR combination

In my case I have a table like
Field1 = Char
Field2 = Num
Field3 = Num
Field4 = Num
Field5 = Num

I want a filter like
oRs.Filter:=Field1 = 'CL' AND ((Field2 = 2 AND Field3 = 3) OR (Field4 = 2 AND Field5 =3))
But that give an error.
So I changed it like
oRs.Filter:=(Field1 = 'CL' AND Field2 = 2 AND Field3 = 3) OR (Field1 = 'CL' AND Field4 = 2 AND Field5 =3)
That give no error, but the result is not correct. The second part (Field1 = 'CL' AND Field4 = 2 AND Field5 =3) give no result
It seems that have to a do a requery with other WHERE conditions.

Is there a way to wake the filter works, because on bij browse, I have some buttons that the user can press to have other filters?

Regards,

Marc



FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Posts: 346
Joined: Mon Oct 05, 2009 03:35 PM
Re: Recordset filter question
Posted: Sat Aug 11, 2018 12:11 PM
SkyPe: armando.lagunas@hotmail.com

Mail: armando.lagunas@gmail.com
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Recordset filter question
Posted: Sun Aug 12, 2018 04:17 AM

FWH created MariaDB library to overcome the limitations of ADO and other MySql libs.
You can work without any such limitations.

Regards



G. N. Rao.

Hyderabad, India

Continue the discussion