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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL select distinct...

Status
Not open for further replies.

ItIsHardToProgram

Technical User
Mar 28, 2006
946
CA
I have the present SQL statement:

SELECT DISTINCT ProjetBaseDon.*, Contacts.*, ProjetBaseDon.[Valeur des honoraires]-((jourFtemps.TotalH)*(Emp.[taux horraire])) AS [Valeur des honnoraires], JourFtemps.TotalH AS honnoraire, JourFtemps.No_Ftemps
FROM Emp, Ftemps, (Contacts INNER JOIN (ProjetBaseDon INNER JOIN Projet_a_contact ON ProjetBaseDon.[# Projet]=Projet_a_contact.no_projet) ON Contacts.no_contact=Projet_a_contact.no_client) INNER JOIN JourFtemps ON Projet_a_contact.no_projet=JourFtemps.No_projet2
WHERE (((JourFtemps.TotalH)>0) And ((Ftemps.Numéro_Feuille_Temps)=jourftemps.no_ftemps));


Presently it not only shows the Project budget that is substracted, but also the total, and all the records everytime a new employee enters a new project in his timesheet.....

So what I want it to do is to take the hours an employee spent on a project (jourftemps.totalH) and multiplicate it by the salary/hour of the employee Emp.[taux horraire] then take that number and substract it to the total budget, so that when the administrator run the query, they see the remaining budget of the project.......

Any help appreciated....
 
Why not doing the math in a Report ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top