9 messages in com.mysql.lists.win32Query question
FromSent OnAttachments
Greg Quinn15 Mar 2004 10:17 
Ignatius Reilly15 Mar 2004 10:26 
Greg Quinn15 Mar 2004 11:09 
Randy Clamons15 Mar 2004 11:19 
Greg Quinn15 Mar 2004 11:23 
Greg Quinn15 Mar 2004 11:36 
Randy Clamons15 Mar 2004 11:52 
Michael Dwyer15 Mar 2004 13:59 
Greg Quinn15 Mar 2004 23:05 
Subject:Query question
From:Greg Quinn (gr@i-online.co.za)
Date:03/15/2004 10:17:35 AM
List:com.mysql.lists.win32

I have the following query...

SELECT Users_Name, sum(houramount + (minuteamount / 60)) as ExprHoursWorked,
(sum(houramount + minuteamount / 60) * activitycharge) as exprcharge From
Officium_ActivityRecord inner join officium_activities on
officium_activities.activityid = officium_activityrecord.activityid group by
users_name

The problem is, some of the records being parsed have an activitycharge of 0, so
obviously if I try to work out exprcharge it will return 0. How can I write this
query, to keep all records, but not make exprcharge be calculated if the
activitycharge = 0 ??

Thanks