HANA SQL- Date and Time Functions

light111Few useful date and time functions

Below are few useful functions that helps to get the day, month, year, hour, minute and second from the date and time.

The test program that calls the AMDP method.

2


 

CURRENT_DATE – gives the current date .

 EXTRACT( ) – function to get day, month or year. 

Another alternative is to use

DAYOFMONTH( ) – to get the day of the month

MONTH( )– to get the month

YEAR( )– to get the year

DAYOFYEAR( )– to get the day of the year

12

DAYOFMONTH ( ), MONTH( ), YEAR ( )-

6

DAYOFMONTH ( ), MONTH( ), YEAR ( ), DAYOFYEAR( )-

7

CURRENT_DATE gives the current date and NEXT_DAY ( )- Function returns the very next date.

8


Similarly to get the HOUR,MINUTE or SECOND either the extract function or direct functions can be used.

3

5


 

Leave a Reply