Formatting

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

Guest

What is the best way to print a value in a report based on the contents of a
field.

I have a field [Billing Code]
if [Billing Code] = A I want to print "Private"
If [Billing Code] = "WC" I want to print "Wokers Comp"
If [Billing Code] = "NF" I want to print "Auto"

In the past I have used and IIF statement in the query to produce a new
field. But that only works for up to 2 values.
 
You could nest the IIf statements:

IIf([Billing Code] = "A", "Private", IIf([Billing Code] = "WC", "Wokers
Comp", IIf([Billing Code] = "NF","Auto", "Don't Know")))

better, though would be to have a lookup table that contains this
information, and join it to your table.
 
Back
Top