Access: Day Function

In Access, the Day function returns an integer between 1 and 31, inclusive, that represents the day of the month corresponding to the date provided as an argument.

The syntax for the Day function is:

Day ( 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

Day(#05/05/1985#)     returns 5 
Day (#17/07/2005#)    returns 17

VBA Code

Dim MyDay As Integer 
MyDay = Day(#04/12/1997#)

This example uses the Day function to obtain the day from a specified date.  Now the MyDay  variable would contain the value of 4.

SQL query

You can also use the Day function in a query.

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

admin

Leave a Reply

Your email address will not be published.