This must be a simple query, but after reading through many posts on the topic I can't get it to work.
I have a table called payslips with columns including payslip_id, tax and net_pay. I want to calculate the totals for tax and net pay. I select sum in the function box for the tax field but running the query gives me SUM("tax") 0.
Please help?
[Solved] Sum total of column in database
[Solved] Sum total of column in database
Last edited by Hagar Delest on Mon Feb 27, 2017 2:47 pm, edited 1 time in total.
Reason: tagged [Solved].
Reason: tagged [Solved].
OpenOffice 4 Windows 8
- charlie.it
- Volunteer
- Posts: 417
- Joined: Wed Aug 21, 2013 2:12 pm
- Location: Italy
Re: Sum total of column in database
Ciao, please compare your database with mine.
- Attachments
-
- Test.odb
- (4.79 KiB) Downloaded 374 times
charlie
Italian AOO Admin
macOS 14 Sonoma M1: Open Office 4.1.15 - LibreOffice 7.5.7.1
http://www.charlieopenoffice.altervista.org
Italian AOO Admin
macOS 14 Sonoma M1: Open Office 4.1.15 - LibreOffice 7.5.7.1
http://www.charlieopenoffice.altervista.org
Re: Sum total of column in database
Thank you Charlie, your help is much appreciated. You make it look so simple, which I'm sure it should be. I set up a database like yours, ran a sum query and got the results as shown on the screenshots attached. Can you make sense of it?
Mike
Mike
- Attachments
-
- Test.odb
- (3.17 KiB) Downloaded 142 times
OpenOffice 4 Windows 8
Re: Sum total of column in database
The difference is that charlie.it has used decimal fields (numeric) whereas you have used text fields (string).
Cheers
David
OS - Slackware 15 64 bit
Apache OpenOffice 4.1.15
LibreOffice 24.2.1.2; SlackBuild for 24.2.1 by Eric Hameleers
David
OS - Slackware 15 64 bit
Apache OpenOffice 4.1.15
LibreOffice 24.2.1.2; SlackBuild for 24.2.1 by Eric Hameleers
Re: Sum total of column in database
Hooray, that was it!
Thank you David and Charlie.it.
Thank you David and Charlie.it.
OpenOffice 4 Windows 8