Page 1 of 1

[Solved] Sum of fields is 0,68 instead of 16:20 hours

Posted: Sun Sep 11, 2022 12:36 pm
by rodolfosrwolf
hey guys. Im trying make consult, but when i use function Sun in libreoffice base (to add up the hours) the result return some value fraction, different true Sum. Exemple: I have values in my hor field 08:00, 06:00 and 02:20, naturally result is 16:20, but libreoffice base return 0,68. Help-me Guys. I use Postgresql DB and libreoficeba for interface.

 Edit: Changed subject, was Sum Field hour 
Make your post understandable by others 
-- MrProgrammer, forum moderator 

Re: Sum Field hour

Posted: Sun Sep 11, 2022 3:35 pm
by FJCC
I know nothing about Postgresql but I'll note that 16:20 = 16.333 hrs = 0.6805 days.

Re: Sum Field hour

Posted: Sun Sep 11, 2022 4:08 pm
by Villeroy
The office suite handles times as decimal day fractions. A form or report will convert the decimal 0.68056 into the correct time 16:20:00.

Re: Sum of fields is 0,68 instead of 16:20 hours

Posted: Tue Sep 13, 2022 3:43 pm
by rodolfosrwolf
Thank you very much for your interest for help-me, I didnt know this, I'II see how it goes in the report. But i wanted the sum to show up on my form.

Re: Sum of fields is 0,68 instead of 16:20 hours

Posted: Tue Sep 13, 2022 5:12 pm
by Villeroy
The form will show the correct result formatted field with number format [HH]:MM. The brackets ensure that the full amount of hours is shown.
30 hours with HH:MM --> 6:00 (that is the clock time six hours after midnight)
30 hours with [HH]:MM --> 30:00 (amount of time)

A LibreOffice report can be tweaked in the same way.

Re: Sum of fields is 0,68 instead of 16:20 hours

Posted: Tue Sep 13, 2022 6:34 pm
by rodolfosrwolf
You're right, I used the formatted field and change format for time. Im very greteful for your help.