Hi,
I have a start time and an end time that I need to subtract (I really need to substract only a few minutes). I try to use the following functions but the result is NULL:
SELECT minutes_sub(to_timestamp(t.horafin,"mmss"), minute(to_timestamp(t.horaini,"mmss")) )
FROM table t;
t.horaini, t.horafin are string
With my data:
to_timestamp(t.horafin,"mmss") = 00:17:03
to_timestamp(t.horaini,"mmss") = 00:16:06
minute(to_timestamp(t.horaini,"mmss")) = 6
.... and minutes_sub(to_timestamp(t.horafin,"mmss"), minute(to_timestamp(t.horaini,"mmss")) ) = NULL
... and I need 00:00:57
If I use the function: datediff(to_timestamp(t.horafin,"mmss"), to_timestamp(t.horaini,"mmss")) the result is also NULL.
Can you help me please?