Hi Everyone,
I write a sql query to calculate the profit base on only buying price and selling price and percentage profit itemwise, and total profit on base of quantity of items.
It works fine in mariadb database console.
But when I tried to build a query report it give the below error:-
My sql query is given below:--
Write a SELECT query. Note result is not paged (all data is sent in one go).To format columns, give column labels in the query.
[Label]:[Field Type]/[Options]:[Width]
Example:
Employee:Link/Employee:200
Rate:Currency:120
My sql query is given below:--
select `tabSales Invoice Item`.name,`tabSales Invoice Item`.creation,`tabSales Invoice Item`.item_name,`tabSales Invoice Item`.rate,`tabItem Price`.price_list_rate,((`tabSales Invoice Item`.rate-`tabItem Price`.price_list_rate)*100)/`tabItem Price`.price_list_rate AS "% Profit on each Item", `tabSales Invoice Item`.qty, `tabItem Price`.price_list_rate*`tabSales Invoice Item`.qty AS "Total_Buyuing_Price",`tabSales Invoice Item`.amount,`tabSales Invoice Item`.amount-(`tabItem Price`.price_list_rate*`tabSales Invoice Item`.qty) AS "Total Profit on no. of Items" from `tabSales Invoice Item`,`tabItem Price` where `tabSales Invoice Item`.item_name=`tabItem Price`.item_name AND `tabItem Price`.buying=1 order by `tabSales Invoice Item`.name;
Could you help me to build this query report.
Regards
Amit Bondwal