Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1021
  • Last Modified:

MonthName in MS Access Report

can anybody tell me the equivalent of the MonthName() function of VB in MS Access Report? i just have to print the month and all i have is the numerical value of it.  for example, i have the value of 3 for March.  i tried using MonthName to display the name of the month but it seems that MS Access does not support this function. any ideas?
0
nick_faye
Asked:
nick_faye
1 Solution
 
shanesuebsahakarnCommented:
You can use:
Format([MyDateField],"mmmm")
to get the name of the month corresponding to the date in MyDateField.
0
 
HobsonTCommented:
Or if you only have the month number, not the full date then you could use Choose([MonthNumber],"January","February","March","April",...)

Hope this helps

Trevor
0
 
Benjamin_LukCommented:
Nick,

I suggest you use following formular, it is more easy:

=iif(Month[MyDateField]=1,"Jan.",iif(Month[MyDateField]=2,"Feb.",iif(Month[MyDateField]=3,"Mar.",iif(Month[MyDateField]=4,"Apr.",iif(Month[MyDateField]=5,"May",....))))))))))))

Ben
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
taylorm_taylormCommented:
You can also use a formula like this:
    format(dateadd("m",3,#dec 1#),"mmmm")

Where 3 is the month number.  Basically, you're adding the number of months to Dec 1 (of whatever year) to get a date, and then only showing the Month value.

Hope it helps.
0
 
shanesuebsahakarnCommented:
If you don't have a full date, you can cheat:
Format(DateSerial(2000,<month number>,1),"mmmm")

Benjamin_Luk, there is one problem with your suggestion - you can only have a maximum of (I believe) 9 nested IIf statements.
0
 
nick_fayeAuthor Commented:
it worked!
thanks to all those who answer my question... i really appreciate it...
0
 
Benjamin_LukCommented:
shanesuebsahakarn,

Thanks. I just forgot add iif( & iif(...

0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now