You could nest the IIf statement, but it gets ugly quick.
IIf([# of bags]=1,"A", IIf([# of bags]=2,"B","C"))
I usually won't nest more that 3 IIf's in the same statement. But what to do
then? Two choices.
1. Create a table like so:
Bags Rating
1 A
2 B
3 C and so on.
Then join this table in a query. This works good if there is a 1-1
relationship between the bags and ratings. However once you get into
something like Between 5 and 10 = D, it has problems.
2. You could create a public function in a module that uses Case. It's much
easier to maintain.
Function fBags(strBags As Variant) As String
Dim TheBags As String
Select Case strBags
Case = 1
TheBags = "A"
Case = 2
TheBags = "B"
Case 3 To 10
TheBags = "C"
Case Else ' Other values.
TheBags = "Z"
End Select
fBags = TheBags
End Function
In a query:
TheRate: fBags([# of bags])