This topic is locked

Calculate total Hours in jiont sql query

6/12/2007 2:26:37 PM
PHPRunner General questions
R
Razkat author

I want tot make a total off `Gewerkte uren`in the following SQL Query:
select `KlantID`,

_klanten.`Bedrijfsnaam`,

`Adres`,

`Postcode`,

`Woonplaats`,

`Projectnaam`,

`Projectomschrijving`,

`Medewerker`,

`Gewerkte uren`

From `_klanten`

inner join _projecten

on _klanten.`Bedrijfsnaam` =_projecten.`Bedrijfsnaam`

inner join _uren

on _uren.`Project`=_projecten.`Projectnaam`

where _projecten.`status` = "Voltooid"
There are more dates with hours (Gewerkte Uren) on a Project. I want to Calculate the total off al off the Hours.
I have tried this:
SUM(Gewerkte uren) as Totaal gewerkte uren
But that don't work.
Please help me!!!

Sergey Kornilov admin 6/12/2007

Check the following tutorial that explains how aggregate functions work in SQL:

http://www.webcheatsheet.com/sql/interacti...sql_groupby.php