Double Parentheses in Queries

Options

 Can you write a query in the form:

A and B and C and ((D and E) or F or G)

Or do I have to merge three queries?

Thanks

Comments

  • JoAnn Strommen
    JoAnn Strommen ✭✭✭✭✭
    Ancient Membership Facilitator 4 Name Dropper Photogenic
    John Trezise:

     Can you write a query in the form:

    A and B and C and ((D and E) or F or G)

    Or do I have to merge three queries?

    Thanks

    Don't believe you can put two "(" symbols together as clicking it again removes it.  I don't think you can.  Depending on if you're using summary fields or a repeat of a field you might be able to.  Caution: placement of the "( )" really affects your outcome.  Be sure to have a few records you can track to see if you're getting expected results.

    Also may want to see Knowledgebase solution:

    How to use parentheses in query

    The parentheses function in Query is a powerful tool that can better narrow query results and make the criteria of a complex query easier to read and track during query construction. This document describes the basic procedures of how to use parentheses in query.BB24257
  • John Trezise:

     Can you write a query in the form:

    A and B and C and ((D and E) or F or G)

    Or do I have to merge three queries?

    Thanks

    You can't nest parentheses in this manner, but there is a workaround:

    A and B and C and (F or (D and E) or G)

    This works.  Sometimes I don't have two single-line criteria for a query, so I'll add my one single-line criteria twice (F or (D and E) or F).  This also works.

  • Jason Black:

    You can't nest parentheses in this manner, but there is a workaround:

    A and B and C and (F or (D and E) or G)

    This works.  Sometimes I don't have two single-line criteria for a query, so I'll add my one single-line criteria twice (F or (D and E) or F).  This also works.

    Wait what? I've been using RE forever and a day and I have always labored under the impression that double parentheses are invalid no matter what.

    Really, just having them not butt up against each other is the key? This could change everything...

    Edit: to clarify, that means if you wanted to say (A or (B and C)), you could basically say (A or (B and C) or A) and make it work that way. That is very very interesting if so. And it makes me think of all the time I've wasted merging queries...

  • James Andrews:
    Wait what? I've been using RE forever and a day and I have always labored under the impression that double parentheses are invalid no matter what.

    Really, just having them not butt up against each other is the key? This could change everything...

    Edit: to clarify, that means if you wanted to say (A or (B and C)), you could basically say (A or (B and C) or A) and make it work that way. That is very very interesting if so. And it makes me think of all the time I've wasted merging queries...

    [quote user="James Andrews"]Edit: to clarify, that means if you wanted to say (A or (B and C)), you could basically say (A or (B and C) or A) and make it work that way. That is very very interesting if so. And it makes me think of all the time I've wasted merging queries...[/quote] Agreed! A whole lot of wasted time. Damn! You CAN teach an old dog new tricks! Thanks

Categories