Curriculum
Course: SQL
Login

Curriculum

SQL

SQL References

0/80

MySQL Functions

0/139

SQL Server Functions

0/84

SQL Quick Ref

0/1
Text lesson

Hour

Example

Retrieve the hour from a specified time.

SELECT Hour(#14:48:23#);

Definition and Usage

The Hour() function retrieves the hour component from a time or datetime value, returning an integer between 0 and 23.

Syntax

Hour(time)

Parameter Values

Parameter

Description

time

Required. A numeric or string expression that represents a valid time or datetime value.

Technical Details

WORKS IN

From Access 2000

More Examples

Example

Retrieve the hour of the current time.

SELECT Hour(Now());

Example

Retrieve the hour from a specified datetime.

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