问题
This is a follow-up of a previous requestion. Here Is the link
It Was about selecting Value from the same field twice with different conditions and display results in separate fields
And Used Following Code In table Adapter - IIF
SELECT AttendanceReg.StudentID,AttendanceReg.Studname, AttendanceReg.StudSex,
AttendanceReg.StudCourse,
SUM(IIf( AttendanceReg.AttendStatus = 'Present', 1,0)) AS TotalPresent,
SUM(IIf( AttendanceReg.AttendStatus = 'Absent', 1,0)) AS TotalAbsent,
DatePart('m', AttendanceReg.DateOfAttendance) AS MYMONTH
FROM (AttendanceReg
INNER JOIN LocalTable ON
AttendanceReg.StudCourse = LocalTable.AttendCourse
AND
DatePart('m', AttendanceReg.DateOfAttendance) = LocalTable.AttentMonth)
GROUP BY AttendanceReg.StudentID, AttendanceReg.Studname,
AttendanceReg.StudSex, AttendanceReg.StudCourse,
DatePart('m', AttendanceReg.DateOfAttendance)
ORDER BY DatePart('m', AttendanceReg.DateOfAttendance) DESC
Also, I Have Tried by Replacing "IIF" With "Switch" Like Below
SUM(SWITCH(EmpAttendance.AttendStatus = 'Present',1,
EmpAttendance.AttendStatus = 'Absent', 0)) AS TotalPresent,
SUM(SWITCH(EmpAttendance.AttendStatus = 'Absent',1,
EmpAttendance.AttendStatus = 'Present', 0)) AS TotalAbsent,
Both the Querys Are Working Prefectly While Testing. But this what happening While trying to create table adapter :(
- how to solve this issue?
- Can use any other Query instead of this?
来源:https://stackoverflow.com/questions/41888400/error-in-list-of-function-arguments-not-recognized-unable-to-parse-query-t