Hi, >SELECT TD.project_id, P.project_manager >FROM time_daily TD >INNER JOIN projects P ON P.project_id = TD.time_project_id >WHERE TD.time_user_id = 'xpt' AND ( >SUM( TD.time_hours_worked ) <> '0.00'
an Paul Dibois said: You cannot use aggregate functions like SUM() in the WHERE clause. And He is right (of curse). But you can use an alias of a formarly selected SUM() in a HAVING clause. If i understood your query, this migth help: SELECT TD.project_id, P.project_manager, SUM( TD.time_hours_worked ) as a_sum FROM time_daily TD INNER JOIN projects P ON P.project_id = TD.time_project_id WHERE TD.time_user_id = 'xpt' GROUP BY TD.project_id , P.project_manager HAVING a_sum <> '0.00' I hope I understood the query the right way. prosit Klaus -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]