MS Access Second() Function

The Second() function in MS Access extracts the seconds component from a time or datetime value. It's useful for working with time data and performing time-based analysis or filtering.



Second(): Definition and Usage

This function is helpful when you need to focus on the seconds part of a time. You might use it to analyze events based on their seconds, create detailed time logs, or filter data based on specific second intervals.

Syntax

Syntax

Second(time)
      

Parameter Values

Parameter Description
time A time or datetime value (can be a literal like #14:48:23#, a field name, or an expression that evaluates to a time/datetime). This is required.

Examples

Extracting Seconds from a Time

This example retrieves the seconds part from the time 2:48:23 PM.

Syntax

SELECT Second(#14:48:23#);
      
Output

23
      

Extracting Seconds from the Current Time

Getting the current seconds.

Syntax

SELECT Second(Now());
      
Output

(The current second (0-59))
      

Extracting Seconds from a Datetime

Getting the seconds component from a specific datetime.

Syntax

SELECT Second(#24/10/2016 11:18:34 PM#);
      
Output

34