SQL HELP
Posted: Tue Feb 13, 2007 11:46 am
this is my code
Date (dd/mm/yyyy)
I need to show the info like this:
NumCaso=187
NombreProy=Welfare
Lastname=Smith
Name=John
Year=2007
Hours by Year=400 ( summatory of hours on year 2007 by john smith in the welfare proyect)
Valorhh=10
187 Welfare Smith John 2007 400 4000
I need it on Access
and I have another problem
with the same bd, another question:
187 Welfare jan feb march april may jun july aug sept oct nov dec 2007
Smith John 100 70 60 20 30 50 50 20 0 0 0 0 400
Code: Select all
SELECT HH.NumCaso, Proyectos.NameProy, Empleados.Lastname, Empleados.Name, HH.Date, Sum(HH!Hours) AS [Hours by Year], Sum(HH!Valorhh*HH!Hours) AS [Total valor anual], HH.Cargo
FROM Proyectos INNER JOIN (Empleados INNER JOIN HH ON Empleados.IdEmpleados = HH.IdEmpleados) ON Proyectos.NumCaso = HH.NumCaso
GROUP BY HH.NumCaso, Proyectos.NombreProy, Empleados.Lastname, Empleados.Name, HH.Date, HH.Cargo;
I need to show the info like this:
NumCaso=187
NombreProy=Welfare
Lastname=Smith
Name=John
Year=2007
Hours by Year=400 ( summatory of hours on year 2007 by john smith in the welfare proyect)
Valorhh=10
187 Welfare Smith John 2007 400 4000
I need it on Access
and I have another problem
with the same bd, another question:
187 Welfare jan feb march april may jun july aug sept oct nov dec 2007
Smith John 100 70 60 20 30 50 50 20 0 0 0 0 400