?
Solved

MonthName in MS Access Report

Posted on 2003-03-19
7
Medium Priority
?
1,017 Views
Last Modified: 2013-11-28
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
Comment
Question by:nick_faye
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 41

Expert Comment

by:shanesuebsahakarn
ID: 8171314
You can use:
Format([MyDateField],"mmmm")
to get the name of the month corresponding to the date in MyDateField.
0
 
LVL 2

Accepted Solution

by:
HobsonT earned 60 total points
ID: 8171529
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
 
LVL 8

Expert Comment

by:Benjamin_Luk
ID: 8171561
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
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
LVL 1

Expert Comment

by:taylorm_taylorm
ID: 8171836
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
 
LVL 41

Expert Comment

by:shanesuebsahakarn
ID: 8171841
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
 

Author Comment

by:nick_faye
ID: 8171956
it worked!
thanks to all those who answer my question... i really appreciate it...
0
 
LVL 8

Expert Comment

by:Benjamin_Luk
ID: 8172488
shanesuebsahakarn,

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

0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question