[Solved] Adding field totals together

Discuss the database features
Post Reply
chris_petersen
Posts: 22
Joined: Tue Mar 21, 2017 5:22 pm

[Solved] Adding field totals together

Post by chris_petersen »

I am looking for a little direction as to where I am going wrong with this issue. I am trying to add the billable hours together for each client in my dbase but I end up with is this cryptic error.
Any help would be greatly appreciated.

Thanks.
Hours Query.JPG
Error.JPG
Last edited by chris_petersen on Wed Apr 05, 2017 9:23 pm, edited 2 times in total.
Chris Petersen
Open Office 4.1.3
FJCC
Moderator
Posts: 9274
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Adding field totals together

Post by FJCC »

You have to Group by every column that is not in the SUM; SUM is the aggregate function. If you want the sum of billable hours per Client, regardless of the Project_Number or Start_Date or any other column, then you have to drop those columns from the query. If you want the sum of billable hours for every combination of Project_Number, Start_Date, etc., then add a Group By condition to those columns as you did to Client.
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
Sliderule
Volunteer
Posts: 1279
Joined: Thu Nov 29, 2007 9:46 am

Re: Adding field totals together

Post by Sliderule »

Please see the link below, and, carefully read the Explanation(s) given:

viewtopic.php?f=61&t=80832&p=372728

I hope this helps, please be sure to let me / us know.

Sliderule

Thanks to add [Solved] in your 1st post Subject (edit button top right) if this issue has been resolved.
chris_petersen
Posts: 22
Joined: Tue Mar 21, 2017 5:22 pm

Re: Adding field totals together

Post by chris_petersen »

I probably gave the wrong description to this post. What I actually was looking for was a way to take any jobs from one client and give me a grand total of billable hours for that client.
After reading all of the info in the manuals and forums, I don't think that it works that way. I will probably end up exporting to a spreadsheet and total them up from there.
I did find the report navigator extension today but it seems to have the same issue.

FJCC, you did solve the error that I was having though. Thanks for that.
Hours.JPG
Query.JPG
Chris Petersen
Open Office 4.1.3
User avatar
Sliderule
Volunteer
Posts: 1279
Joined: Thu Nov 29, 2007 9:46 am

Re: Adding field totals together

Post by Sliderule »

chris_petersen wrote:I probably gave the wrong description to this post. What I actually was looking for was a way to take any jobs from one client and give me a grand total of billable hours for that client.
Per your description ( and my instructions on the link I gave you ) . . . REMOVE . . . the check marks on all columns EXCEPT for:
  1. Client
  2. Billed_Hours
Explanation: This will return, for the given Client , a sum of all Billed_Hours.

I hope this helps, please be sure to let me / us know.

Sliderule

Thanks to add [Solved] in your 1st post Subject (edit button top right) if this issue has been resolved.
chris_petersen
Posts: 22
Joined: Tue Mar 21, 2017 5:22 pm

Re: Adding field totals together

Post by chris_petersen »

Thanks for trying Slidrule. I appreciate the help.

Not exactly what I was thinking it would do.
No worries, I will keep playing with the wizard and design view to see if I can figure out something.
If worse comes to worse, I will export the column out and run it through a spreadsheet.
They probably won't use that function much anyway unless they need hours for a budget or something.

Chris
Chris Petersen
Open Office 4.1.3
chris_petersen
Posts: 22
Joined: Tue Mar 21, 2017 5:22 pm

Re: Adding field totals together

Post by chris_petersen »

Hi Sliderule,

I re-created the query from scratch rather than modify the existing one with the info you provided and it works now. It looks the same as the other but it works this time. I must have had something hidden or a bad field.
I have no idea. I wanted to thank you for the help. Below is what I ended up with. It gives me the total hours between two dates. I will probably add the dates to the report.

Chris
Query.JPG
Hours.JPG
Chris Petersen
Open Office 4.1.3
Post Reply