AND, OR in Reports

Sep 18, 2006 2 Replies

in any report in RMS, there's no way to put brackets when using operator to set the priority of the "AND" and "OR", this result in wrong report results, for example, if I'm trying to get the sales for specific item in a specific period specifying that the "date sold is between X and Y " and itemlookupcode = 'A' or itemlookupcode = 'B' or itemlookupcode = 'C', this will give us wrong results coz the sales will be true for the first item only but for the other two items, I'll be having all their sales, not in the specified period.


Is this true? or am i missing something?


Yes. To get the query "A AND (B OR C)" to work properly, you have to format it as "A AND B OR A AND C". The OR operator seems to reset the query.

So,

"date sold is between X and Y " and itemlookupcode = 'A' or itemlookupcode = 'B' or itemlookupcode = 'C'

should be

"date sold is between X and Y" and itemlookupcode = 'A' or "date sold is between X and Y" and itemlookupcode = 'B' or "date sold is between X and Y" and itemlookupcode = 'C'

Yes it definitely helps, thank u

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required