Quantcast
Channel: Teradata Forums - Database
Viewing all articles
Browse latest Browse all 14773

Help calculating an average Start Time? - response (1) by dnoeth

$
0
0

I'm afraid you can't do an average on a TIME :-(
But it's not that complicated :-)

   TIME '00:00:00'
   + CAST(AVG(EXTRACT(HOUR FROM starttime) * 3600 + 
              EXTRACT(MINUTE FROM starttime) * 60 +
              EXTRACT(SECOND FROM starttime)) AS INT) * INTERVAL '00:00:01' HOUR TO SECOND

 
Btw, you can do an AVG(DATEcol)...
Dieter


Viewing all articles
Browse latest Browse all 14773

Trending Articles



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