I'm trying to calculate the time driffrence between two columns, the columns have data: DECIMAL
I´ve tried to mix with:
TIMESTAMPDIFF(16, CHAR(TIMESTAMP('1997-03-01-00.00.00')
- TIMESTAMP('1997-02-01-00.00.00')))
but the data makes it complicated, anyone have any idea, how to make it work with a DECIMAL?
I managed to make som string transformation and actually get the time right with this code, but now I try to calculate the diffrence between them but I´m stuck.
cast( substr( right( '00' ||cTime, 4) ,1,2) || ':' ||substr( right( '00' ||cTime, 4) ,3,2) as time) as "changeTime",
cast( substr( right( '00' ||iTime, 4) ,1,2) || ':' || substr( right( '00' ||iTime, 4) ,3,2) as time) as "inTime"
This is the code I want to make the difference between,
I expect the output:
| 10:27:00 | 10:30:00 | 3 |
If someone need more information, let me know so I can edit with more information. Any help would be appreciated.
Version: 7.3 DB2 on AS400