How do I use an IIf statement to return names of the month instea.

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

Guest

In a report, in a header, I want an unbound text box to change a number into
the name of the month. I have written the statement =IIf([Month]=1,"January")
and get the return January. But I cannot expand the statement to contain the
other 11 months. All I get are the usual error messages about commas, syntax,
operands and operators. What symbol or word must I use to continue the
statement?
 
The IIF statement isn't a problem - IIf([Month]
=1,"Jan",iif([Month]=2,"Feb",iif([month]=3..... etc but a
possible easier way is to set up a table with two fields
MthNo & MthName and enter the values 1 to 12 & Jan to Dec
then in the field use:-
=DLookUp("[MthName]","MyTable","[MthNo] =" & [Month])
 
Back
Top