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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formula Help

Status
Not open for further replies.

wizzy337

Technical User
May 30, 2002
21
US
Hi All:

Can someone help me with this? I'm new to Crystal Reports and I'm attempting to write this formula:

({USER.USERNAME} IN ["x","x","x","x"])
AND ({PROD.NEW_SALE_PRICE}+{PROD.RENEWAL_PRICE})

I get this message "A boolean is required here".

What does this mean? and what should I do?

Thanks in advance!
 
Well since you give no indication what you intend to do other than a malformed formula, it's difficult, try posting requirements and the software in use (Crystal,database).

What is yourexpected output???

Anyway, the first 1/2of your formula returns aboolean/true/false, doesit existthere, then you say and add some amounts. Programmingdoesn;t work like that, the first part (a conditional) would generally be in an IF and use a THEN to show what should happen.

Or perhapsthis is a record selection formula, in which case it doesn'tmake sense because of the AND part.

So state WHERE you are trying this formulka, wht and what you expect, not here's something broken, show me something that isn't broken.

Try:

if ({USER.USERNAME} IN ["x","x","x","x"]) then ({PROD.NEW_SALE_PRICE}+{PROD.RENEWAL_PRICE})
else
0

There's a formula example.

-k
 
Thanks for the formula example. That did the trick :).

I was working in the Formula Editor window & I wanted to write a formula that would select a certain set of users. Once those users were selected, I wanted to know the total sales revenue generated by those users.

Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top