Skip to content
Related Articles

Related Articles

Improve Article

Day() and Hour() Function in MS Access

  • Last Updated : 03 Sep, 2020

1. Day() Function :
Day() function returns the day of the month for a given date. In this function, it will take a date as a parameter and it will return the day of that date. The returned day will between 1 to 31.

Syntax :

Day(date)

Example-1 :

SELECT Day(#02/23/2020#);

Output –

23

Example-2 :



SELECT Day(#09/10/2010#);

Output –

10

2. Hour() Function :
Hour() function returns the hour part of given datetime. In this function the datetime will be passed as parameter.and it will return the hour part of that. The returned hour part will be range 1 to 23.

Syntax :

Hour(time)

Example-1 :

SELECT Hour(#04/10/2020 01:08:24 AM#);

Output –

1

Example-2 :

SELECT Hour(#12:40:33#);

Output –

12

Attention reader! Don’t stop learning now. Learn SQL for interviews using SQL Course  by GeeksforGeeks.

My Personal Notes arrow_drop_up
Recommended Articles
Page :