Access: Month Function

In Access, the Month function returns an Integer between 1 and 12, inclusive, containing the month part of a date.

The syntax for the Month function is:

Month ( date )

The required time argument is any numeric or string expression, that can represent a date. If number is Null, this function returns a Null.

Examples

Month (#05/05/1985#)      returns 5 
Month (#17/07/2005#)      returns 7

VBA Code

Dim MyMonth As Integer 
MyMonth = Month(#04/12/1997#)

This example uses the Month function to obtain the month from a specified date.  Now the MyMonth variable would contain the value of 12.

SQL query

You can also use the Month function in a query.

SELECT Month(#14/02/2005#) AS Expr1 
FROM Orders
admin

admin

Leave a Reply

Your email address will not be published.