Adding millisecond to date in SAP HANA


Try using ADD_SECONDS function as below:

SELECT ADD_SECONDS (TO_TIMESTAMP('2017-07-15 02:17:15'), 0.1) FROM TEST

This will add seconds as fraction value as requested. Below is syntax and example:

ADD_SECONDS

Syntax

ADD_SECONDS (t, n)

Description

Computes the time t plus n seconds.

Example:

SELECT ADD_SECONDS (TO_TIMESTAMP ('2012-01-01 23:30:45'), 60*30) "add seconds" FROM DUMMY;

add seconds

2012-01-02 00:00:45.0

To know more about ADD_SECONDS function, you can also refer this link:

datetime function in SAP HANA

To know more about SQL functions in SAP HANA system, you can also refer our HANA tutorial:

SAP HANA SQL Functions

Anil SAP Gupta
Anil SAP Gupta

SAP Expert

Updated on: 25-Jun-2020

395 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements