AND, OR in Reports

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?

Reply to
Nashat
Loading thread data ...

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'

Reply to
Teester

Yes it definitely helps, thank u

Reply to
Nashat

BeanSmart website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.