Question

I need to calculate the variance in minutes or hours from two columns. Using datediff(hh,start,stop) is sometimes to big and datediff(mi,start,stop) is sometimes to little. How can I get it show up as hh:mm? Thanks!

Was it helpful?

Solution

SELECT {fn TRUNCATE(DATEDIFF('mi',start,stop)/60,0)}
       || ':' 
       ||{fn MOD (DATEDIFF('mi',start,start) ,60)} 
From MySchema.MyTable
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top