1) StudentExamStatus
2)StudentExamStatusDetail
The report StudentExamStatus show the report of students whether they have passed or failed. The second report StudentExamStatusDetail shows the particular student information with the score they have achieved in each exam.
First Report Query text
create table #studentmarks (studentid int identity(1,1),studentname varchar(50),subjectname varchar(250),marks smallint,Ispassed Char(1))
insert into #studentmarks values ('A','Social',80,'P'),
('A','Science',50,'P'),
('A','English',90,'P'),
('B','Social',30,'F'),
('B','Science',50,'P'),
('B','English',90,'P'),
('C','Social',80,'P'),
('C','Science',70,'P'),
('C','English',90,'P')
select
studentname,
(select top 1 (case IsPassed when
'P' Then 'Passed'
WHEN 'F' then 'Failed' else null end) from #studentmarks s1 where
s1.studentname =
s.studentname order
by Ispassed asc) AS ExamStatus
from
#studentmarks s
group by studentname
drop table #studentmarks
Create a Data Source.
No comments:
Post a Comment