This MSAccess tutorial explains how to use the Access Month function with syntax and examples.
The Microsoft Access Month function returns the month (a number from 1 to 12) given a date value.
The syntax for the Month function in MS Access is:
Month ( date_value )
The Month function can be used in the following versions of Microsoft Access:
Let's look at how to use the Month function in MS Access:
Month (#22/11/2003#) Result: 11 Month (#01/01/1998#) Result: 1
The Month function can be used in VBA code in Microsoft Access.
Dim LMonth As Integer LMonth = Month(#12/03/2001#)
In this example, the variable called LMonth would now contain the value of 3.
You can also use the Month function in a query in Microsoft Access.
In this query, we have used the Month function as follows:
The first Month function will extract the month value from the date 13/08/1985 and display the results in a column called Expr1. You can replace Expr1 with a column name that is more meaningful.
The results would now be displayed in a column called MonthValue.
The second Month function will extract the month value from the CategoryDate field and return the results in a column called Expr2.
(scroll to see more)