Answer the question
In order to leave comments, you need to log in
How to stack in a text field?
Hello! I made a cross query in which you need to specify the total values.
Request:
TRANSFORM Min(last.absent) AS [Min-absent]
SELECT last.studentid, Min(last.absent) AS Total_Absents, Min(last.absent) AS Total_Lates
FROM [last]
GROUP BY last.studentid
PIVOT last.am_day;
Answer the question
In order to leave comments, you need to log in
With the help of IIF () you can catch the desired values.
https://docs.microsoft.com/en-us/sql/t-sql/functio...
TRANSFORM Min(last.absent) AS [Min-absent]
SELECT last.studentid, SUM(IIF(last.absent="-1", 1, 0)) AS Total_Absents, SUM(IIF(last.absent="L", 1, 0)) AS Total_Lates
FROM [last]
GROUP BY last.studentid
PIVOT last.am_day;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question