totn Access Functions

MS Access: Time Function

This MSAccess tutorial explains how to use the Access Time function with syntax and examples.

Description

The Microsoft Access Time function returns the current system time.

Syntax

The syntax for the Time function in MS Access is:

Time ()

Parameters or Arguments

There are no parameters or arguments for the Time function.

Returns

The Time function returns a numeric value between 0 and 0.999988426.

Applies To

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

  • Access 2019, Access 2016, Access 2013, Access 2010, Access 2007, Access 2003, Access XP, Access 2000

Example

Let's look at how to use the Time function in MS Access:

Time()
Result: '10:42:58 PM'   (your answer will differ)

Example in VBA Code

The Time function can be used in VBA code in Microsoft Access.

For example:

Dim LValue As String

LValue = Time

In this example, the variable called LValue would now contain the current system time.

Example in SQL/Queries

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

For example:

Microsoft Access

In this query, we have used the Time function as follows:

Expr1: Time()

This query will return the current system and time and display the results in a column called Expr1. You can replace Expr1 with a column name that is more meaningful.

For example:

CurrentTime: Time()

The results would now be displayed in a column called CurrentTime.