inclusive "and" part of query not working

I am trying to exclude certain records from the report using the select record expert in CR, but when ever I set up the query like this (see bold part of query),

{investor.holdings} and
(not ({receiver.r_ussname} startswith "NON-USS:") and not ({investor.iaccountid} in ["35048"])) and
{trade.mdate_i} > {?Start Date} and
{trade.settle_i} <= {?Start Date} and
(not ({trade.icobbill} in ["B", "P"]) or {trade.iaccountid} = ["10107","12462","15227","10119","19331","10301","32051","32013","32109"])

CR keeps changing the query structure to this:


{investor.holdings} and
not ({receiver.r_ussname} startswith "NON-USS:") and
not ({investor.iaccountid} in ["35048"])
and
{trade.mdate_i} > {?Start Date} and
{trade.settle_i} <= {?Start Date} and
(not ({trade.icobbill} in ["B", "P"]) or {trade.iaccountid} = ["10107","12462","15227","10119","19331","10301","32051","32013","32109"])

and what happens is that it processes the augments separately instead of inclusively.

I am trying to use (not ({receiver.r_ussname} startswith "NON-USS:") and not ({investor.iaccountid} in ["35048"])) as a way to tell CR not to return records where both the receiver.r_ussname begins with "NON-USS" and the accountid begins with "35048". In otherwords, dont return any records where it is both "NON-USS" and "35048".

Not sure why this is happening, but there are two different tables that I am trying to query against in that statement, maybe that is the issue? If so, how do I get around that?

**Inclusively...I hope I used the right terminology.
IO_DorkAsked:
Who is Participating?
 
Raghavendra HullurConnect With a Mentor Software DeveloperCommented:
When you say "what happens is that it processes the augments separately instead of inclusively. ", does that mean the data is wrong? or not returning records at all?

Can you try using below modified one and update the results?

{investor.holdings} and
not ( ({receiver.r_ussname} startswith "NON-USS:") and  ({investor.iaccountid} in ["35048"])) and
{trade.mdate_i} > {?Start Date} and
{trade.settle_i} <= {?Start Date} and
(not ({trade.icobbill} in ["B", "P"]) or {trade.iaccountid} = ["10107","12462","15227","10119","19331","10301","32051","32013","32109"])
0
 
mlmccCommented:
The reason it is happening is since all the Boolean operators are AND there is no need for the ( ) around the pair.

I believe the suggestion above is what you want.

You could also do it as

(NOT ({receiver.r_ussname} startswith "NON-USS:") OR
 not ({investor.iaccountid} in ["35048"]) )

mlmcc
0
 
Raghavendra HullurSoftware DeveloperCommented:
Closing this as the question has become inactive and the solution provided is confirmed as best as per other expert's confirmation.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.