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

Ranges in Formulas

Status
Not open for further replies.

mmt4331

Programmer
Dec 18, 2000
125
US

The following return of the formula gives me a return value of "WOW!" for every item in the detail section even when Last Year's Sales are under $100,000. Anybody know why and how can I fix it? I also put for example, CCur(100,000) on every dollar figure and it still won't work. Thx.



WhileReadingRecords;
Select {Customer.Last Year's Sales}
Case upfrom 100,000:
"WOW!"
Case 80,000 to_ 100,000:
"Good"
Case 70,000 to_ 80,000:
"Average"
Case 60,000 to_ 70,000:
"Poor"
Default:
"Forget it!";
 
I have never used CASE statement but I do know that they are supported. I use multiple If-Thens as follows:


If {Customer.Last Year's Sales} >=100000 then "WOW" else
If {Customer.Last Year's Sales} in 80000 to 99999 then "GOOD" else
If {Customer.Last Year's Sales} in 70000 to 79999 then "AVERAGE" else
If {Customer.Last Year's Sales} in 60000 to 69999 then "POOR" else "FORGET IT"


Software Training and Support for Macola, Crystal Reports and Goldmine
251-621-8972
dgilsdorf@mchsi.com
 
Can the WhileReadingRecords. It's WhilePrintingRecords you want.

Naith
 

Naith:

The WhilePrintingRecords didn't work. Any other way?

Mark
 
You don't need Whileprintingrecords or Whilereadingrecords.

If the formula is exactly as you state, remove the commas. I think you'll find Crystal is taking 100,000 as just 100 etc. Some countries use "," for the decimal point.

I tried the formula your way and got all WOW!s for values over 100, after removing the commas it worked properly.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top