Pregunta

Estoy utilizando TIMESTAMPDIFF en dB derby para recuperar la diferencia de tiempo entre 2 Tiempo: Fecha de inicio y enddate. p.ej.

startdate = 2010-02-23 02:59:52.045 enddate = 2010-02-23 03:45:39.898

select {fn timestampdiff(SQL_TSI_HOUR, startdate, enddate)} as diff 

Me gustaría saber cómo puedo obtener el diff tiempo en horas, por ejemplo, 0,25, etc?

Gracias.

¿Fue útil?

Solución

select {fn timestampdiff(SQL_TSI_MINUTE, startdate, enddate)}/60 as diff 

y que yo llamaría las variables StartDateTime y endDateTime.

Otros consejos

específicamente para su uso diferencia HORAS "SQL_TSI_HOUR"

select {fn timestampdiff(SQL_TSI_HOUR, startdate, enddate)} as diff 

ver aquí: https://docs.faircom.com/doc/sqlref/ 33476.htm

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top