tech on the net

MS Access: Month Function

Learn how to use the Access Month function with syntax and examples.

Description

The Microsoft Access Month function returns the month (a number from 1 to 12) given a date value.

Syntax

The syntax for the Microsoft Access Month function is:

Month ( date_value )

Parameters or Arguments

date_value is a valid date.

Applies To

The Month function can be used in the following versions of Microsoft Access:

Example

Month (#22/11/2003#) would return 11
Month (#01/01/1998#) would return 1

Example (in VBA Code)

The Month function can be used in VBA code in Microsoft Access. For example:

Dim LMonth As Integer

LMonth = Month(#12/03/2001#)

In this example, the variable called LMonth would now contain the value of 3.

Example (in SQL/Queries)

You can also use the Month function in a query in Microsoft Access.

Microsoft Access