Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sum hours fields into another table

Status
Not open for further replies.

wbower34

IS-IT--Management
Dec 29, 2018
4
0
0
US
Evening,

I can not figure out what I am missing on the following select statement, where the output of the select statement with sums on the two hours fields. Would like to direct it to a table created by doing a select into with only 3 pieces of data for member. Then I can join with the members detail table to compile the information.

This works, but I have not been able to get just three pieces of data to write into another table.

select "nmember", sum(volhours) as Vol, sum(advtrnghrs) as ADV
from "Naturalisthrs".naturalisttimesheet group by nmember


When I tried doing the same idea in this query, I get names but no sums for each member.

select "Lname", "Fname", sum(volhours) as Vol, sum(advtrnghrs) as ADV
from "Naturalisthrs".naturalisttimesheet as A
right outer join
"Naturalisthrs".naturalist_members as B
on a.nmember = b.abbrname
where "Status" = 'A'
group by "Fname", "Lname"
order by "Lname"


I believe I have a logic error but, have looked too long and can not find it.

thanks in advance.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top