Question: How to build complicated queries?
03 Feb 2002 14:15:37 -0800
On Sun, 2002-02-03 at 14:07, Derek Atkins wrote:
> Dave Peticolas <firstname.lastname@example.org> writes:
> > > 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'.
> 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.
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
-----END PGP SIGNATURE-----