Click here to Skip to main content
15,900,461 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi all,

i have two tables
data in table

table name Income
srno name amt
1 sales 1000
2 sales 2000
3 sales 3000

table name Expence
srno name amt
1 salary 1234
2 rent 2067


i want these both table data in crystal reports.
when i select two tables in crystal reports then it displays only two record.
there is three records in first table and two records in second.
i want all data from both table in one crystal reports.

it displays....

srno name amt srno name amt
1 sales 1000 1 salary 1234
2 sales 2000 2 rent 2067


i want .....

srno name amt srno name amt
1 sales 1000 1 salary 1234
2 sales 2000 2 rent 2067
3 sales 3000





thanks,
Posted
Updated 14-Dec-11 15:20pm
v4

 
Share this answer
 
v2
Comments
RaviRanjanKr 13-Dec-11 16:14pm    
5!
By default, joins are done as inner joins, which means you will only get results where there are matching records in each table.

Create yourself a view that uses a left join between Income and Expence, like this:

SQL
select LIST_OF_FIELDS
from Income
left join Expence on Income.srno = Expence.srno


Side note - Expense is spelled with an S.
 
Share this answer
 
Comments
[no name] 17-Dec-11 0:55am    
same problem facing.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900