Hour

Return the hour of the day (a number from 0 to 23) from a given time (or Date/Time) value.

Syntax
      Hour(time_value)

Key
   time_value  A valid time.

The Hour() function can be used in VBA or in an SQL query.

hour

Examples

Dim intDemo as integer
intDemo = Hour(dtmShiftEnd)
intDemo = Hour(#08:55:00 AM#)
intDemo = Hour(#30/12/2012 08:55:00 AM#)

Select * from orders where Hour(Order_date) = 17;

“What would be the use of immortality to a person who cannot use well a half an hour” ~ Ralph Waldo Emerson

Related

Day - Return the day of the month.
DatePart - Return part of a given date.
Minute - Return the minute of the hour.


 
Copyright © 1999-2024 SS64.com
Some rights reserved