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

Determine if a number is in a range 1

Status
Not open for further replies.

bdjb

Technical User
Joined
Oct 29, 2002
Messages
292
Location
US
Hello,
I'm using Crystal 11. I'm trying to determine if a number is in a range: I have a distance field (say 89 miles), and I need to group by mileage, 50, 100, 150, etc miles. So I'm trying to figure how to write a formula to check that?

Thanks!
 
Do a formula field,
Code:
if isnull({your.milage}) 
then "a) No milage"
else if {your.milage} < 50
then "b) Less than 50"
else if {your.milage} < 1000
then "c) Up to 100"
...
This will sort in order, and could also be used for grouping.



[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Thank you for that suggestion, it worked quite well. I set the result of the formula as my group.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top