How can i optain Salary slip report with all components or just a component and its value of all employee with help of Query Reports?

Am building a query report and I need to fetch a component from the salary slip but I don’t know how to go about it since it’s not a field in the salary slip. How can I write the query to fetch the component from Earning or deduction table in the salary slip.

Please help me out.

Hi there,

Both Earnings and Deductions are tables that store data in the Salary Detail child doctype (called tabSalary Detail in mariadb). To get that data, you just need to do a join in your sql query on tabSalary Slip.name = tabSalary Detail.parent