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

Discuss the database features
Post Reply
rodolfosrwolf
Posts: 3
Joined: Sun Sep 11, 2022 12:24 pm

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

Post 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 
Last edited by MrProgrammer on Tue Sep 13, 2022 8:22 pm, edited 5 times in total.
Reason: Tagged ✓ [Solved] -- MrProgrammer, forum moderator
OpenOffice 7.04 on Windows 8.1
FJCC
Moderator
Posts: 9274
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Sum Field hour

Post by FJCC »

I know nothing about Postgresql but I'll note that 16:20 = 16.333 hrs = 0.6805 days.
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Sum Field hour

Post 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.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
rodolfosrwolf
Posts: 3
Joined: Sun Sep 11, 2022 12:24 pm

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

Post 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.
OpenOffice 7.04 on Windows 8.1
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

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

Post 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.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
rodolfosrwolf
Posts: 3
Joined: Sun Sep 11, 2022 12:24 pm

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

Post by rodolfosrwolf »

You're right, I used the formatted field and change format for time. Im very greteful for your help.
OpenOffice 7.04 on Windows 8.1
Post Reply