Frappe command for Aggregate functions

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 ) FROMtabSales 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

1 Like

Thank You @saurabh6790
It works now!!!

frappe.db.sql("""SELECT SUM( grand_total ) FROM 'tabSales Invoice' """)[0][0]