Invalid Procedure Call error in select sum query (1 Viewer)

ayha

New member
Local time
Today, 12:02
Joined
Jul 17, 2019
Messages
1
I use the following SQL select query in MS Access to generate result on large input data:


SELECT "1.01" AS Item ,"Name" AS Test ,Count([Item]) AS [Count] ,Sum(IIf([Results] = "Invalid", 1, 0)) AS [# Invalid] FROM [Test 1-01] GROUP BY "1.01" ,"Name" ,"Yes";

I got an 'Invalid Procedure call' error. I traced down the part of the query that caused the error is

Sum(IIf([Results]="Invalid",1,0)) AS [# Invalid]


Does anyone have any idea of how to fix this error ?

Table 'Test 1-01' is the Access table that I loaded with large number of data.

There's a column 'Results' contains text Valid, Invalid, etc.
I want to get a count of total number of records and number of records of 'Invalid' results.

The query worked before,but it started getting 'Invalid Procedure call' error with new data load.

Thanks for all help.
 

CJ_London

Super Moderator
Staff member
Local time
Today, 20:02
Joined
Feb 19, 2013
Messages
16,609
you can't start field names with non-alphanumeric character

AS [# Invalid]
 

Users who are viewing this thread

Top Bottom