sql - New report from two tables with reportviewer doesnt have true result -
i create new view in sql server 2008 2 tables have relation on field. want create report , grouping on common field.
for example:
table1: student(id,first-name,last-name,phone,address,...) table2: courses(id,fk_id,course,....) now want have report shows data both tables grouping on id student table, must show courses information separated every student. query is:
select top (100) percent dbo.tbl_student.id, dbo.tbl_student.firstname, dbo.tbl_student.lastname, dbo.tbl_courses.coursename, dbo.tbl_courses.coursedate, dbo.tbl_courses.coursetype, dbo.tbl_student left outer join dbo.tbl_courses on dbo.tbl_student.id = dbo.tbl_courses.fk_id order dbo.tbl_student.firstname desc but when create new report view, shows 1 record every group. spent 2 hours solve problem did not succeed. please me create report 2 or more tables.
now shows 1 record duplicates several times every group
have tried query this:
select s.[id], s.[first-name], s.[last-name], s.[phone], ... c.[id], c.[course], ... student s left outer join courses c on s.[id] = c.[fk_id]
Comments
Post a Comment