Question: How to build complicated queries?

Dave Peticolas dave@krondo.com
03 Feb 2002 14:15:37 -0800


--=-xuS+iaso/bFVF2TO1LZB
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

On Sun, 2002-02-03 at 14:07, Derek Atkins wrote:
> Dave Peticolas <dave@krondo.com> writes:
>=20
> > > For example, I want a query to be:
> > >=20
> > >         a && (b || (c && d))
> >
> > To ensure grouping in a complicated expression, it's
> > best to combine two simpler queries together with
> > xaccQueryMerge. So you might create the query for
> > c && d, and a query for 'b', and combine them, and
> > then combine the resulting query with one for 'a'.
>=20
> Ok, if I'm going to create the query for, e.g. c AND d,
> what's the right way of doing that?  In particular, I
> only want one logic operator, but I have to supply one
> with each term.  Do I need to create both the 'c' and
> 'd' terms with AND, or do I put 'OR c' and 'AND d', or
> is there something else what I'm missing?

The operator for the very first term in a query is ignored.
So you choose QUERY_AND when you add the second one and you
should get what you want.

dave


--=-xuS+iaso/bFVF2TO1LZB
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQA8XbaJ5effKKCmfpIRAkWSAJ9gwrgnqxDWCnY4O2o8veBs9W+ILgCdENxm
g7bwdGeOOm+73LbfJThCzYQ=
=19D/
-----END PGP SIGNATURE-----

--=-xuS+iaso/bFVF2TO1LZB--