substract value

General
Enthusiast

substract value

How can I substract col2 from col1?

col1 is  timestamp(0)  12/12/2014 12:08:00

col2 is varchar column   03:04:00

1 REPLY
Junior Supporter

Re: substract value

Hi.

SELECT COL1 - CAST(COL2 AS INTERVAL HOUR TO SECOND);

HTH.

Cheers.

Carlos.