Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

question about group and subreport

Status
Not open for further replies.

zhenyulu

Programmer
Jun 16, 2004
16
0
0
US
I use CR9&Visual Studio c#.net. The database is MSSQL Server 2000. I am using OLEDB.

I have three tables like this:
talbe1:
College department address phone
c1 CS Arizona 11111111
c1 Math Arizona 22222222
c2 CS FL 43333333
c2 Math FL 44444444

table2:
college department employee_number
c1 CS 100
c1 Math 200
c1 Chemical 300
c2 CS 100
c2 Math 200
c2 Chemical 300


table3:
College department emplyee age
c1 CS mike 18
c1 Math tom 19
c2 CS john 20
c2 Math mike 21



The result report should be like this:


(group by college)
College c1
(Following are all records in table2 when college = c1)
[department] [employee_number]
CS 100 (******)
Math 200

(group by department)
department CS detail
[department] [employee] [age]
CS mike 18

department Math detail
[department] [employee] [age]
Math Tom 19


College c2 address phone
[department] [employee_number]
CS 100 (**********)
Math 200


department CS detail
[department] [employee] [age]
CS Jone 20
department math detail
[department] [employee] [age]
Math Mike 21


This is a subreport for a big report. The problem is that it only shows one record in table2 ( I marked using **). How to show all the records? I tried inner-join, left-join, right-join to do it. But it still show one record there.

Any ideas? Thanks.
 
Try pasting in the SQL used or generated for the report.

I would guess that you have some criteria on the child table to limit the rows, which states that you don't really want a LO join, but only those rows.

-k

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top