Horje
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



Reffered: https://www.geeksforgeeks.org


SQL

Related
Year() Function in MS Access Year() Function in MS Access
Sequence with examples in SQL Server Sequence with examples in SQL Server
Month() and Minute() Function in MS Access Month() and Minute() Function in MS Access
MonthName() and Now() function in MS Access MonthName() and Now() function in MS Access
Orphan User in SQL Server Orphan User in SQL Server

Type:
Geek
Category:
Coding
Sub Category:
Tutorial
Uploaded by:
Admin
Views:
8