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

If/Then/Else Help 2

Status
Not open for further replies.

CRadel

Technical User
Jun 3, 2011
15
US
Hi. I'm sure I am missing something really simple here, but...

I have a Gift Amount field, and I want a formula that says IF the amount is less than $2500, THEN the field should be printed with an asterisk (eg: $1,000*) or ELSE just print the Gift Amount.

I'm using Crystal Reports 8. Can someone help me with the formula, with any parentheses, quotation marks, etc. that I may need? Also, do I need to do anything special to format the $ sign and/or cents? The field is currently formatted correctly to show $1,000 or $1,289.45, but I'm not sure if the asterisk will change things.

Thanks so much in advance!

Carol


 
I do not have crystal in front of me, but i think something like this will do what you ask.


IF {table.GiftAmt} > 2500 then "$" & totext({table.GiftAmt}) else "$" & totext({table.GiftAmt}) & "*"
 

You could create a formula to add the asterisk, but it would be difficult to get the field to align properly.

Instead, consider creating a text object that only contains the *. Place it immediately to the right of the gift amount field, and then right click --> Format Field --> Common tab.

Click the X2 next to Suppress and enter this:

{your gift amount field} < 1000
 
Thank you both so much!

fisheromacse, I tried your way but couldn't get past a message saying "result of selection formula must be a boolean."

briangriffen, this worked perfectly.

Many thanks!
Carol
 
Why are you using the formula in the selection criteria? I would think that you would use in a formula as a field.
 
kray4660, I am sure I did something wrong. I'm not a very frequent user, as you can probably tell.
 
It appears that the error message you are getting is from the selection criteria which filters the data. Not sure what version of Crystal you are using, but you should be able to view the field explorer and in there you should be able to create a new formula. Once you create the formula you should be able to place it on the report just like other fields. I hope this helps.
 
i should have been more clear, sorry.
Kray nailed it. Create a new formula and replace the value in the report with the formula.
but...i like brian's idea better. simpler to implement and to manage later on.
 
Thanks again everyone! I really appreciate the help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top