Recordset filter question

Recordset filter question

Postby Marc Vanzegbroeck » 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
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

Re: Recordset filter question

Postby armando.lagunas » Sat Aug 11, 2018 12:11 pm

SkyPe: armando.lagunas@hotmail.com
Mail: armando.lagunas@gmail.com
User avatar
armando.lagunas
 
Posts: 346
Joined: Mon Oct 05, 2009 3:35 pm
Location: Curico-Chile

Re: Recordset filter question

Postby nageswaragunupudi » Sun Aug 12, 2018 4: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
User avatar
nageswaragunupudi
 
Posts: 10632
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot], Silvio.Falconi and 121 guests