0

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!

eatonphil
  • 13,115
  • 27
  • 76
  • 133

1 Answers1

1
SELECT {fn TRUNCATE(DATEDIFF('mi',start,stop)/60,0)}
       || ':' 
       ||{fn MOD (DATEDIFF('mi',start,start) ,60)} 
From MySchema.MyTable
psr
  • 2,870
  • 18
  • 22