Como fazer um sum no Interbase em campo do tipo Time

Firebird

17/03/2004

Olá pessoal,
Eu tenho uma consulta select na qual eu dou um SUM em um campo tempo para emitir um relatório. Porém no Interbase acontece o seguinte erro :

´Unsuccessful execution caused by system error that does not preclude successful execution of subsequent statements.
data type not supported for arithmetic.´.

Existe alguma solução para somar tempo no interbase :?:

Abraço a todos.
Fernando AMP


Fernandolegal

Fernandolegal

Curtidas 0

Respostas

Maicongabriel

Maicongabriel

17/03/2004

Sei que não é [b:80e983d1f8]elegante[/b:80e983d1f8], mas funciona! Se alguem tiver algo mais [b:80e983d1f8]bonito[/b:80e983d1f8], por favor poste! :wink:

/* Vai retornar o SUM do tempo total em Segundos! O resto fica por sua conta... */
SELECT SUM(CAMPOTIME - CAST(´00:00:00.000´ AS TIME)) FROM TABELA



GOSTEI 0
Afarias

Afarias

17/03/2004

|Sei que não é elegante, mas funciona!

É a solução correta e não tem nada de deselegante ;)


T+


GOSTEI 0
Fernandolegal

Fernandolegal

17/03/2004

Obrigado galera...

Funcionou corretamente.

Valeu mesmo !


GOSTEI 0
POSTAR