MonthName function

mh123

Registered User.
Local time
Today, 21:51
Joined
Feb 26, 2014
Messages
64
Hi

A small puzzle I am hoping someone can help with, a field in my query needs to just show the month name of the date value so I have
Month: MonthName([Field Here]), False] which I believe should give me a non abbreviated month name in my field. When I view my query it returns #Func!
If I use Month: Month([Field Here]) it returns the correct value, but I would like it to show the month name rather then the number.

Any one can offer some guidance?

Thanks
 
Ah, figured it out
EventMonth: MonthName((Month([Field Here])))
Feel free to delete thread if necessary mods sorry to waste space/time!!
 
The MonthName function takes in the Month Number as argument, not the Date. So try,
Code:
MonthName(Month(FieldName), False)
 
Why use monthname at all? Format(Yourdate, "MMM") or MMMM does the same?
 
namliam

that would only display it as a month name. If you need the value to be the name (string) then you use MonthName()
 
Format(Date, "MMMM") is exactly the same as Monthname(month(date))

Only difference you use one function instead of two
 
Isskint, namliam is right Format is a simpler method over MonthName. As a matter of fact the return type of Format is still a String.
 
Isskint, namliam is right Format is a simpler method over MonthName. As a matter of fact the return type of Format is still a String.
Paul,
True it is a simpler method and that is what the OP should use in that scenario. Also true is that Format(Date, "MMMM") is exactly the same as Monthname(month(date)) but Format(expression, "MMMM") is not the same as Monthname(month). I thought it important to acknowledge the difference between the two functions.
MonthName is best suited to identifying the name of a month, where the expression has been entered as a number 1 - 12.
Format() is best suited where a full date (or Long variable) is entered as the expression.
MonthName(4) would give you April but Format(4,"mmmm") would give you January.
 
Obviously, however, a month only rarely should be stored as 1,2,3,4... shouldnt it? assuming a more or less proper design offcourse....
 
Thanks for the comments, the Format way definitely looks simpler which is good to know it does the same thing for a standard date field - will definitely use that going forward I think :)!
 

Users who are viewing this thread

Back
Top Bottom