
Resta de horas varchar2, timestamp, to_char
Publicado por Yogui (7 intervenciones) el 30/05/2014 17:46:43
Holaaaa a todos, tengo un problema, resulta que tenía horas y quería restarlas, pero las tenía como varchar2(8) -el formato que tiene en la BD es 11:23:43 por ejemplo- Entonces hice lo siguiente:
(TO_CHAR((to_timestamp(B.HORA_REGIS,'HH24:MI:SS'))-(TO_timestamp(C.HORA_INGSI,'HH24:MI:SS'))))TIEMPO "
Y el valor que me devuelve es el formato timestamp en caracteres: +000000000 05:59:52.000000000
Resulta que yo quiero que me muestre con el formato hh:mm:ss entonces hice eso:
SUBSTR((TO_CHAR((to_timestamp(B.HORA_REGIS,'HH24:MI:SS'))-(TO_timestamp(C.HORA_INGSI,'HH24:MI:SS')))),11,8)
Pero no me funciona :/
¿Algua sugerencia?
Gracias :)
(TO_CHAR((to_timestamp(B.HORA_REGIS,'HH24:MI:SS'))-(TO_timestamp(C.HORA_INGSI,'HH24:MI:SS'))))TIEMPO "
Y el valor que me devuelve es el formato timestamp en caracteres: +000000000 05:59:52.000000000
Resulta que yo quiero que me muestre con el formato hh:mm:ss entonces hice eso:
SUBSTR((TO_CHAR((to_timestamp(B.HORA_REGIS,'HH24:MI:SS'))-(TO_timestamp(C.HORA_INGSI,'HH24:MI:SS')))),11,8)
Pero no me funciona :/
¿Algua sugerencia?
Gracias :)
Valora esta pregunta


0