Day() and Hour() Function in MS Access

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
My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


Article Tags :
Practice Tags :


Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.