Click here to Skip to main content
15,904,156 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
im working with sql and crystal report this is my query..

VB
SELECT `tblpr`.`PR_Number`, `tblpr`.`Date_Submitted`, `tblpr`.`Date_Needed`, `tblpr`.`Department`, `tblpr`.`Purpose`, `tblprproducts`.`Product_Name`, `tblprproducts`.`Brand`, `tblprproducts`.`Description`, `tblprproducts`.`Part_Number`, `tblprproducts`.`Quantity`, `tblprproducts`.`Unit_Measurement`, `tblsignatories`.`Signatory1`, `tblsignatories`.`Designation1`, `tblsignatories`.`Signatory2`, `tblsignatories`.`Designation2`, `tblsignatories`.`Signatory3`, `tblsignatories`.`Designation3` FROM   (`tblpr` `tblpr` INNER JOIN `tblprproducts` `tblprproducts` ON `tblpr`.`PR_Number`=`tblprproducts`.`PR_Number`) INNER JOIN `tblsignatories` `tblsignatories` ON `tblpr`.`PR_Number`=`tblsignatories`.`PR_Number` where tblpr.pr_number = '" & lstpr.FocusedItem.SubItems(0).Text & "' and tblprproducts.pr_number = '" & lstpr.FocusedItem.SubItems(0).Text & "'"


this query will return 4 records from the database that's good, but when it is displayed in crystal report 4 records will be displayed 16 records.. each item is repeated 4 times..

what should be the problem?

thanks in advance!
Posted
Comments
ShaikhM 24-May-12 18:21pm    
First of all. Check this link.

http://www.dpriver.com/pp/sqlformat.htm

It is a very helpful link that formats all you sql statements for you. That makes it a lot easier to read.

And now getting back to you question. I think you have to include more details.
1) What version of CR you are using.
2) Do you have any groups?
3) Is all the data in the detail section?
4) What sequence is it displaying records .. 1 item twice together or One set of 4 records after the other.


Quickest way to check is Run SQL Profiler and see what sql query your report is executing when it runs. You will have a better idea then.

1 solution

 
Share this answer
 

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