Help! I can't figure out the error in this query

hammerva

Registered User.
Local time
Today, 11:51
Joined
Dec 19, 2000
Messages
102
Here is my query:

SELECT Format$(Target_Date,"mmm-yy") AS [Month Period], Count(Action_Item_Number) AS Count_Items_Committed, Sum(IIF(Status = "Completed"),1,0) AS Count_Completed
FROM [Action Items]
GROUP BY Format$(Target_Date,"mmm-yy")
HAVING Target_Date <> " ";


I keep getting a message saying 'Wrong Number of Arguments Used with query function is expression" and then it shows the SUM(IIF) statement. I checked the [Action Items] table and I have a field called Status.

I am confused again. What am I goofing up here?
 
No that didn't seem to work. Copied exactly what you had I still get the error about the SUM( IIF) statement. Is there an issue with using a field called Status? Is there a spacing thing going on here? I have no idea

But thanks for the help.
 
Your formula reads: Sum(IIF(Status = "Completed"),1,0)
It should be: Sum(IIF(Status = "Completed",1,0))

Wandering parentheses!
 

Users who are viewing this thread

Back
Top Bottom