Quantcast
Channel: Teradata Forums - All forums
Viewing all articles
Browse latest Browse all 27759

Substracting two TIME(6) datatype values - forum topic by larun1616

$
0
0

HI
    I have two columns Start_Time and End_Date in a table with data type TIME(6) and i want to substract the two values in a stored Procedure.
 
Format:HTML Format Version:1.0 StartHTML: 165 EndHTML: 6526 StartFragment: 314 EndFragment: 6494 StartSelection: 314 EndSelection: 314

SELECT Log_Time INTO vStart FROM DB.LOG_TABLE

SELECT Log_Time INTO vEnd FROM DB.LOG_TABLE

SET vTotal = CAST( CAST(vEnd AS CHAR(6) ) AS INTERVAL HOUR TO SECOND(6) ) -CAST( CAST(vStart AS CHAR(6) ) AS INTERVAL HOUR TO SECOND(6) ) ;
 
When i try to perform the substraction i get the error '
Invalid or missing expression 'E(5407):Invalid operation for DateTime or Interval.'. Please help me.
 
-Arun

Tags: 
Forums: 

Viewing all articles
Browse latest Browse all 27759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>