I m using SQL 'Pivot' to show Student Attendance on monthly basis but facing Error Invalid column name 'DayValue'. Invalid column name 'Stu_Status'
.
M using following SQL Query
Select
StudentID, Stu_Status, DAY([AttandanceDate]) as [DayValue]
From tbl_Students_Attandance as studAttd
PIVOT (Max([Stu_Status])
FOR [DayValue] IN ([1], [2], [3], [4],[5], [6], [7], [8], [9],
[10], [11], [12], [13], [14],[15], [16], [17], [18], [19],
[20], [21], [22], [23], [24],[25], [26], [27], [28], [29],[30])
) AS Piviottable;
using below table Design
To achieve below result Required result Image