Jeannier1975:
That didnt work I need to sum ActualLabor hours.
What didn't? What did you try and where exactly did it go wrong?
If we're to help you then we need a little more involvement from you than "That didn't work".
As I mentioned in my first reply, you share very little information. Basic obvious stuff like what the circumstances are and what you're trying to do - even in general terms.
Summing is a fine concept, but it has very different results depending on what grouping you're using. Across the recordset as a whole is a very different result from just those within a particular group. I've seen nothing as yet to tell me what it is you're trying to achieve.
The solution provided earlier does work, of course, but you have to use it in accordance with whatever it is you expect.
Sum()
within a single record simply gives you the same value back. Even then you'd need to specify the grouping in the
GROUP BY
clause in order for it to work for you.
The other major problem is that whenever you do any aggregating within a query then the query expects everything to be aggregated, obviously. It couldn't possibly give you the aggregated results unless there is some understanding of grouping, and if there is such an understanding then individual values make no sense. What would be the name value of a grouped set of records encompassing multiple records each with a different name?
There are techniques that allow us to get around such restrictions. What I said before is still true but we can nevertheless link to separate queries that allow us to find an aggregated total that is linked into each individual record. That would have to be created and made available in a separate section of course.
As I say possible, but we'd need a far clearer explanation of what you're actually after if we're even to make a start in that direction. Hopefully it won't be necessary but from your posted SQL I would guess that's where we're heading. Not enough to be sure but the indications are there.