Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ANDs ORs

Status
Not open for further replies.

AntonioPerera

Vendor
Jan 29, 2006
91
AU
My problem is as follows :

I have a a database of chart of accounts with the following 3 segments:

10000-000-A
10000-100-A
10000-200-A
11000-100-B
11000-900-B

Account - Department - Category

I need to sort them by the following criteria :

01 All items ending in category "R" and all items ending in categories "F" & "T" in the range of departments "700" to "799"
See formula below
02 All items in Category C
03 All items in category Z

//01
if {?YEAR YYYY} = "2010" and
{@category} in ["R"]
and
({@dept} like "7*")
or
{@category} in ["F","T"])
then
01

My formula for 01 is not giving the desired results.
Can you see anything wrong ?
 
You have too many ()

//01
if {?YEAR YYYY} = "2010" and
{@category} in ["R"]
and
({@dept} like "7*"
// removed ) after "7*"
or
{@category} in ["F","T"])
then
01

Ian
 
I think it should be:

if {?YEAR YYYY} = "2010" and
(
{@category} = ["R"]
or
(
{@dept} like "7*")
and
{@category} in ["F","T"]
)
)
then
1

...although I would like to see the content of your formulas for category and dept if this doesn't work. I'm assuming that you mean all category R and only those categories F and T that fall in the 700 range.

-LB
 
Also that could just be:

{@category} = "R"//no brackets

..although it won't really affect the results.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top