Tangara G

Tangara G

  • NA
  • 298
  • 90.1k

Crystal report - complicated sql query

Sep 19 2016 4:40 AM

 
 
I have the above table namely departmentRequisition and departmentRequisitionDetail respectively.
 
From the departmentRequisitionDetail, there is a column - departmentRequisitionId - 112 and many rows of acutalQuanity that I need to add up as a total quantity to display as a pie chart.
 
Now, in order to know the department that ties to this total qauntity, I need to refer to another table - departmentRequisition which shows the deparmentId - 2 which ties to this departmentRequisitionId.
 
 
Can someone advise how should I write the query so that I can generate the pie chart ?
The above is just for one departmentId and I need to have different departmentId showing the acutalquanity which is the quantity they ordered.
 
Or is there a better way to generate my crystal report based on the scenario above ?  Like create another table to make things easier.
 
 

Answers (9)