Re: Filterproblem with ADOQuery while mixing AND & OR operators



Mani wrote:
> I try to set a filter on my ADOQuery like this:
> (Name='John' OR Firstname='John') AND Birthdate>'2005-01-01'
> When i do this, there comes up an EOleException which tells me that the
> arguments are from the wrong type.
> Following is working fine:
>
> Name='John' OR Firstname='John') OR Birthdate>'2005-01-01'
>
> and this also:
>
> (Name='John' AND Firstname='John') AND Birthdate>'2005-01-01'
>
> It seems that Delphi has a problem in mixing AND & OR Operators in the
> filter.

Not Delphi but ADO itself.

You can always rewrite your filter expression to the one that will
work.
e.g. (Name='John' AND BirthDate > '2005-01-01') OR (Firstname='John'
AND Birthdate > '2005-01-01')

See Microsoft's Q235892 for details.

.



Relevant Pages

  • Re: need similar solution to "cascading combos"...
    ... I learned from Delphi programming that if I sniff around, ... > I'm creating a search form w/ unbound combo boxes ... Also "Filter" is a very specific term in Access, and I think you are using ... programming language, not a database -- so there'll be more to the "Delphi ...
    (microsoft.public.access.forms)
  • Re: need similar solution to "cascading combos"...
    ... Like clone that recordset and reference it in code from ... Also "Filter" is a very specific term in Access, and I think you are using ... to with Combo Boxes. ... This may, indeed, be easy to accomplish in Delphi, but Delphi is a ...
    (microsoft.public.access.forms)
  • Re: Oh no!
    ... Once you select Delphi, it should filter by Delphi and also remember your preference for next time. ... That's what I see when I change the language filter. ... entry was for Delphi $IF directive (which isn't what I was ...
    (borland.public.delphi.non-technical)
  • Re: filer table by a word ....
    ... >Go to Delphi help, find TTable. ... Datestr is either a date picked by the user .. ... delphi to then filter it using the information ...
    (alt.comp.lang.borland-delphi)
  • Transform filter with different input & output media types (crop filter, Delphi)?
    ... I have been trying to create CropFilter in Delphi. ... create filter fine but without cropping. ... GetMediaType call should return media type of output pin. ...
    (microsoft.public.win32.programmer.directx.video)