Please help with this Expression!!

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

When I create the following switch expression to group my data into ranges:

Expr1:
Switch([Stp]<8,"0-8",[Stp]<15,"8-15",[Stp]<20,"15-20",[Stp]<30,"20-30",True,"31>")

When I hit run the query puts the data in this order:

0-8
15-20
20-30
31>
8-15

I want the ranges to be in ascending order. Can anyone give me some advice?
What I have is a large crop production database. I am trying to create
phosphorus (Stp) ranges, and then get the average yield within each range.

Is there a better way? Thanks!
 
Try this -
Switch([Stp]<8,"0-8",[Stp]<15,"08-15",[Stp]<20,"15-20",[Stp]<30,"20-30",True,"31>")
OR this --
Switch([Stp]<8," 0-8",[Stp]<15,"
8-15",[Stp]<20,"15-20",[Stp]<30,"20-30",True,"31>")
 
Back
Top