RB Formula structure

Thanks for all your suggestions, I not getting error messages now but I'm not getting the results I want. If I just do an if statement for one operation number to be complete I get the results that I expected. I am trying to use Opcode from JobOper as the formula field for operation complete per data dictionary info, I click oper complete when entering timecard, What the report is ultimately supposed to do is show all open jobs in each department using specific timecard entry info.
----- Original Message -----
From: Dennis Houghton
To: vantage
Sent: Wednesday, July 18, 2001 11:14 AM
Subject: [Vantage] RB Formula structure


A quick question,
I can't seem to get a formula structured in RB. I am trying to use 2 if statements w/ an or statement, in other words, I would like it to look @ 2 different operation numbers to see if they are complete and if they are to return a specific number else return another specific number to be used as a filter. Here is how I it looks now. IIF(OperCode = '300' And OpComplete = no,1, Or IIF(OperCode = '200' And OpComplete = no,1,2)). This gives me a syntax error.
Thanks
Dennis



[Non-text portions of this message have been removed]


To access the Files Section of our Yahoo!Group for Report Builder and Crystal Reports and other 'goodies', please go to: http://groups.yahoo.com/group/vantage/files/. Note: You must have already linked your email address to a yahoo id to enable access.

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



[Non-text portions of this message have been removed]
A quick question,
I can't seem to get a formula structured in RB. I am trying to use 2 if statements w/ an or statement, in other words, I would like it to look @ 2 different operation numbers to see if they are complete and if they are to return a specific number else return another specific number to be used as a filter. Here is how I it looks now. IIF(OperCode = '300' And OpComplete = no,1, Or IIF(OperCode = '200' And OpComplete = no,1,2)). This gives me a syntax error.
Thanks
Dennis



[Non-text portions of this message have been removed]
Try:

IIF((OpCode = '200' or OpCode = '300') and OpComplete = No,1,2)

-Todd C.

-----Original Message-----
From: Dennis Houghton [mailto:dennis@...]
Sent: Wednesday, July 18, 2001 11:15 AM
To: vantage
Subject: [Vantage] RB Formula structure


A quick question,
I can't seem to get a formula structured in RB. I am trying to use 2 if
statements w/ an or statement, in other words, I would like it to look @ 2
different operation numbers to see if they are complete and if they are to
return a specific number else return another specific number to be used as a
filter. Here is how I it looks now. IIF(OperCode = '300' And OpComplete =
no,1, Or IIF(OperCode = '200' And OpComplete = no,1,2)). This gives me a
syntax error.
Thanks
Dennis



[Non-text portions of this message have been removed]


To access the Files Section of our Yahoo!Group for Report Builder and
Crystal Reports and other 'goodies', please go to:
http://groups.yahoo.com/group/vantage/files/.
<http://groups.yahoo.com/group/vantage/files/.> Note: You must have
already linked your email address to a yahoo id to enable access.

Your use of Yahoo! Groups is subject to the Yahoo! Terms of
<http://docs.yahoo.com/info/terms/> Service.




[Non-text portions of this message have been removed]
Take out the word "Or." Like this:

IIF(OperCode = '300' And OpComplete = no,1,IIF(OperCode = '200' And
OpComplete = no,1,2)).

In this case, if the OperCode is either 300 or 200 AND OpComplete is true,
the value of the field will be 1. If the OperCode isn't 200 or 300 or
OpComplete is 'yes' (regardless of OperCode) the value will be 2.

Jon Hellebuyck
Stremel Manufacturing
-----Original Message-----
From:
sentto-20369-22407-995472953-jhellebuyck=stremel.com@...
[mailto:sentto-20369-22407-995472953-jhellebuyck=stremel.com@...
.com]On Behalf Of Dennis Houghton
Sent: Wednesday, July 18, 2001 11:15 AM
To: vantage
Subject: [Vantage] RB Formula structure


A quick question,
I can't seem to get a formula structured in RB. I am trying to use 2 if
statements w/ an or statement, in other words, I would like it to look @ 2
different operation numbers to see if they are complete and if they are to
return a specific number else return another specific number to be used as a
filter. Here is how I it looks now. IIF(OperCode = '300' And OpComplete =
no,1, Or IIF(OperCode = '200' And OpComplete = no,1,2)). This gives me a
syntax error.
Thanks
Dennis



[Non-text portions of this message have been removed]


To access the Files Section of our Yahoo!Group for Report Builder and
Crystal Reports and other 'goodies', please go to:
http://groups.yahoo.com/group/vantage/files/. Note: You must have already
linked your email address to a yahoo id to enable access.

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



[Non-text portions of this message have been removed]
Try this IIF(OperCode='300' or OperCode='200' and OpComplete=no,1,2)

-----Original Message-----
From: Dennis Houghton [mailto:dennis@...]
Sent: Wednesday, July 18, 2001 11:15 AM
To: vantage
Subject: [Vantage] RB Formula structure


A quick question,
I can't seem to get a formula structured in RB. I am trying to use 2 if
statements w/ an or statement, in other words, I would like it to look @ 2
different operation numbers to see if they are complete and if they are to
return a specific number else return another specific number to be used as a
filter. Here is how I it looks now. IIF(OperCode = '300' And OpComplete =
no,1, Or IIF(OperCode = '200' And OpComplete = no,1,2)). This gives me a
syntax error.
Thanks
Dennis



[Non-text portions of this message have been removed]


To access the Files Section of our Yahoo!Group for Report Builder and
Crystal Reports and other 'goodies', please go to:
http://groups.yahoo.com/group/vantage/files/.
<http://groups.yahoo.com/group/vantage/files/.> Note: You must have
already linked your email address to a yahoo id to enable access.

Your use of Yahoo! Groups is subject to the Yahoo! Terms of
<http://docs.yahoo.com/info/terms/> Service.




[Non-text portions of this message have been removed]
At 12:57 PM 7/18/2001 , you wrote:
>Try this IIF(OperCode='300' or OperCode='200' and OpComplete=no,1,2)

ANDs take precedence before ORs. So if I understood the initial request, I
think it needs a set of parentheses around the OperCode ORs, like:

IIF( (OperCode='300' or OperCode='200') and OpComplete=no, 1, 2)

That's logically equivalent to: (OperCode='300' and OpComplete=no) or
(OperCode='200' and OpComplete=no)

When in doubt, I always stuff in the extra parens. If I or someone else
comes back to my code later, it's more obvious what it was intended to do,
and eliminates any 2nd guessing about the original intent vs the actual logic.

-Wayne Cox