Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get Month Name from a digit in Access Database?

I am trying to figure out how to get month name from a month digit in access database.

I found this: Format(Date, "mmmm"), unfortunately i don't have the date, all i have are the months numbers so that function won't work.

is there an alternative i could use?

Thank you

like image 938
Madam Zu Zu Avatar asked Nov 09 '11 14:11

Madam Zu Zu


People also ask

How do I get the month from a date in Access query?

The Month() function returns the month part for a given date. This function returns an integer between 1 and 12.

How do I filter by month in Access query?

On the Home tab, in the Sort & Filter group, click Advanced and then click Advanced Filter/Sort on the shortcut menu. Type an expression in the Field row in the first column. For example, to sort by month regardless of the year, type the expression Expr1: DatePart("m",[BirthDate]) in the Field row in the first column.

What does NOW () return in Access?

Returns a Variant (Date) specifying the current date and time according your computer's system date and time.


1 Answers

You can use the MonthName(Month) function available in MS-Access.

MonthName(3)            would return 'March'
MonthName(3, TRUE)      would return 'Mar'
MonthName(7, FALSE)     would return 'July'

In Access, the MonthName function returns a string representing the month given a number from 1 to 12.

The syntax for the MonthName function is:

MonthName ( number, [abbreviate] )

number is a value from 1 to 12, representing the month.

abbreviate is optional. This parameter accepts a boolean value, either TRUE or FALSE. If this parameter is set to TRUE, it means that the month name is abbreviated. If this parameter is set to FALSE, the month name is not abbreviated.

Hope! this will help you.

like image 57
Lion Avatar answered Sep 24 '22 11:09

Lion