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

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s