Click here to Skip to main content
15,892,927 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want all records from two tables depending on Bill_no.
I write this query,but it doesn't return any record..
SQL
select st.custName,st.slsDate,st.slsmName,st.vat,st.totalAmt,st.NetAmt,sd.* from salesItemDetails sd,salesDetails st where sd.bill_no=st.bill_no and(sd.bill_no='BI/12-13/000002')


Thanks in advanced...
Posted
Comments
André Kraak 30-Mar-13 10:59am    
Do you get any results when you leave out and(sd.bill_no='BI/12-13/000002')?
JayantaChatterjee 30-Mar-13 11:04am    
No..
The results is blank..... :-(

1 solution

Check your data.

It would appear that there are no records where the bill_no matches exactly. Have a look with SSMS and double check you are using the right database. If you are absolutely sure after that, we would need to see the actual code your are using to retrieve the records.
 
Share this answer
 
Comments
JayantaChatterjee 30-Mar-13 11:25am    
Thanks Sir...
Its My mistake. I didn't insert data in salesItemDetails table, that why it doesn't return records..
OriginalGriff 30-Mar-13 11:43am    
We've all done it! :laugh:

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