Access: IsDate Function

In Access, the IsDate function returns a value indicating whether or not a variant argument can be converted to a date.

The syntax for the IsDate function is:

IsDate ( expression )

The required expression argument is a date expression or string expression recognizable as a date or time.

Example

IsDate (#10/5/2006#)        returns TRUE
IsDate("It's a date")       returns FALSE
IsDate("May 25, 2006")      returns TRUE

VBA Code

Dim MyResult as Boolean 
MyResult = IsDate(“It’s a date”)

The IsDate function can be also used in VBA code. Now the MyResult variable would contain FALSE as a value.

SQL query

You can also use the IsDate function in a query.

SELECT IsDate([FirstName]) AS Expr1, IsDate([BirthDate]) AS Expr2, IsDate(#10/10/2000#) AS Expr3
FROM EmployeeAddressTable
admin

admin

Leave a Reply

Your email address will not be published.