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!

GROUP BY - aggregated function

Status
Not open for further replies.

ItIsHardToProgram

Technical User
Mar 28, 2006
946
CA
Hey every one, I have been reading in the past hour to try and find a way to GROUP BY a LEFT(field,#).

i.e.:

Code:
SELECT Left(T.IdProjet,7) AS ProjetSommaire, Sum(E.SalaireHoraire*(T.Lundi+T.Mardi+T.Mercredi+T.Jeudi+T.Vendredi+T.Samedi+T.Dimanche+T.LundiRD+T.MardiRD+T.MercrediRD+T.JeudiRD+T.VendrediRD+T.SamediRD+T.DimancheRD)) AS [Honoraire utilisé], t.IdEmployer
FROM tblTimeSheet AS T INNER JOIN tblEmployer AS E ON T.IdEmployer=E.IdEmployer
GROUP BY T.IdProjet, t.IdEmployer;

the following works but I would like it to Group By ProjetSommaire, except it won't let me.

Thanks for your help.

"Knowing that you know is the greatest sign of stupidity, knowing that you are ignorant is the best proof of intelligence.
 
GROUP BY LEFT(T.IdProjet,7)

!

Thanks any way!

"Knowing that you know is the greatest sign of stupidity, knowing that you are ignorant is the best proof of intelligence.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top