i want to use the IIF function without the aggregate in my query, so i can accomplish this. I want to get the sum of b.hourly_rate*e.hours_actual if pm.pm_billing_method_id <> "F" . But, if pm.pm_billing_method_id = "F" then i want to just bring the straight value of pm.billing_amount. Is there a way to do this?
Select Sum(IIF(pm.pm_billing_method_id = "F", pm.billing_amount, (b.hourly_rate*e.hours_actual))) AS [Revenue]
This is what i was doing, but it was summing up pm.billing_amount. i want the straight value of pm.billing_amount not the sum. Any help?
Thanks a lot.
-Ryan
One Ring to Rule Them All, One Ring to Find Them, One Ring to Bring Them All, and in the Darkness Bind Them.
Select Sum(IIF(pm.pm_billing_method_id = "F", pm.billing_amount, (b.hourly_rate*e.hours_actual))) AS [Revenue]
This is what i was doing, but it was summing up pm.billing_amount. i want the straight value of pm.billing_amount not the sum. Any help?
Thanks a lot.
-Ryan
One Ring to Rule Them All, One Ring to Find Them, One Ring to Bring Them All, and in the Darkness Bind Them.