Click here to Skip to main content
15,921,179 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I have 2 tables
1) tm_Customer(custId,CName,address,contactNo)
2) tm_booking(bID,Amount,CustID)

data in table
1) tm_customer
1, jagdish,asdf,122334
2, ghi,    qwert,34455
3, jkl,    asdfgh,34521
4, iuy,    lkjff,3434

2) tm_booking
1, 12000,  1
2, 123000, 2
3, 2345,   3
4, 1234,   1
5, 123,    4

I am executing query as following:
SQL
select bid,cName,address,contactno,amount from tm_booking b,tm_customer c where b.custID=c.custId and bid=2;

so result should be
2 ,ghi, qwert, 34455, 12300

I am getting this result in Datatable but when i am assigning this datatable to crystall report. It shows me like this:
2 ,Jagdish, asdf, 122334, 12300
2 ,ghi, qwert, 34455, 12300
2 ,jkl, asdfgh, 34521, 12300
2 ,iuy, lkjff, 3434, 12300

error is single record of booking table assigned to all record of customer table in crystal report.

can any one suggest me solution???
Thanx in advance.
Posted
Updated 8-Apr-13 10:09am
v2

Your query is incorrect. Try:
SQL
select a.bid, a.cName, a.address, a.contactno, b.amount from tm_customer a INNER JOIN tm_booking b ON a.custID=b.custId

Add where clause as per need.
 
Share this answer
 
Your query is incorrect.

Try:
SQL
select a.bid, a.cName, a.address, a.contactno, b.amount from tm_customer a INNER JOIN tm_booking b ON a.custID=b.custId

Add where clause to it as per need.
 
Share this answer
 
Thanx for the help bt i had solve it my self....
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 12-Mar-14 12:07pm    
Not an answer. Such posts are considered as abuse. Use comments instead.
—SA

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