HI all,
Anyone know how to get sum of grand_total from Sales Order.
When I am using ,
frappe.db.sql("""SELECT SUM( grand_total ) FROM
tabSales Order""")
it prints value as
((995.0,),)
How can I format this to get value as β995.00β ?
HI all,
Anyone know how to get sum of grand_total from Sales Order.
When I am using ,
frappe.db.sql("""SELECT SUM( grand_total ) FROM
tabSales Order""")
it prints value as
((995.0,),)
How can I format this to get value as β995.00β ?
The output is nested tuple
use frappe.db.sql("""SELECT SUM( grand_total ) FROM tabSales Order""")[0][0]
to get 995.0
Thank You @saurabh6790
It works now!!!
frappe.db.sql("""SELECT SUM( grand_total ) FROM 'tabSales Invoice' """)[0][0]