Skip to content Skip to sidebar Skip to footer

Summing Only If A Certain Customer In MS Access 2003

I wanted to use a case statement (not recognised by MS Access) but this is what I have instead: Sum(if [Time Report].Cust_id=2 then ([Time Report].[Hrs P1

Solution 1:

I reckon you want:

Sum(iif ([Time Report].Cust_id=2,[Time Report].[Hrs P1],0)) AS [SumOfHrs P1],  
Sum(iif ([Time Report].Cust_id=2,[Time Report].[Hrs P2],0)) AS [SumOfHrs P2], 
Sum(iif ([Time Report].Cust_id=2,[Time Report].[Hrs P3],0)) AS [SumOfHrs P3], 

See http://office.microsoft.com/en-us/access-help/iif-function-HA001228853.aspx


Post a Comment for "Summing Only If A Certain Customer In MS Access 2003"