I'm having problems with the following query:
I want to display the total amount of yes_memberNames that aren't null for each gcNo.
For example, I want the report to display something like this:
gcNo yes_memberName total_yes
2 name1 3
2 name2 3
2 name3 3
4 name1 2
4 2
4 name3 2
Currently, total_yes will appear as 1 for each row if there is a yes_memberName and 0 if there is no yes_memberName.
Please let me know if this is possible or if you need more information in order to help me.
Code:
SELECT gcNo, yes_memberName, SUM(IIf(yes_memberName <> null,1,0)) as total_yes
FROM ballotReportData
Group by gcNo, yes_memberName;
I want to display the total amount of yes_memberNames that aren't null for each gcNo.
For example, I want the report to display something like this:
gcNo yes_memberName total_yes
2 name1 3
2 name2 3
2 name3 3
4 name1 2
4 2
4 name3 2
Currently, total_yes will appear as 1 for each row if there is a yes_memberName and 0 if there is no yes_memberName.
Please let me know if this is possible or if you need more information in order to help me.