You can translate the question and the replies:

Timestamp From 24 Hours Ago of Current Timestamp

Hello, I know that I can get the current timestamp using the currenttimestamp function. I wanted to know what is the right way to subtract 24 hours from the timestamp returned from that function, in order to find the timestamp of exactly 24 hours before the time the function was called. For context, I am trying to use this value in the comparison of a where condition. Any help is appreciated!

1 Answer

Hi, In order to get a the timestamp value before or after certain hours from the current timestamp, I would use the **ADDHOUR()** function. For instance, to get the timestamp 2 hours prior to the current time, I would use the following query in the **VQL shell** of the** Virtual DataPort Administration Tool**: ``` SELECT ADDHOUR(current_timestamp,-2) from dual(); ``` You can take a look at the [Datetime Processing Functions]( section of the Virtual DataPort VQL Guide for more information. Hope this helps!
Denodo Team
05-03-2021 00:47:13 -0500
You must sign in to add an answer. If you do not have an account, you can register here