subtracting from Timestamp column.

Database
Enthusiast

subtracting from Timestamp column.

Hi,

I am copying from one teradata table to another. Both the tables having timestamp(0) columns and the format is 'YYYY-MM-DDBHH:MI:SS'.

While copying i need to perform

table2 timestamp column = (table1 timestamp column - 6 hours).

Thanks in advance
3 REPLIES
Enthusiast

Re: subtracting from Timestamp column.

I tried with the below SQL, but it's not working

Sel
current_timestamp(0)
- (time '06:00:00') hour to second(0)
Teradata Employee

Re: subtracting from Timestamp column.

Try
select current_timestamp(0) - interval '6' hour;
Enthusiast

Re: subtracting from Timestamp column.

Thanks Fred!