How do i use the between operator in frappe.db.count.?
I tried the below count= frappe.db.count('Sales Invoice', {'date': ['between', [from_date, to_date]]})
but gets the value as 0 even though there are records.
The below works to fetch the records though, invoice= frappe.get_all('Sales Invoice', filters={'date': ['between', [from_date, to_date]]}
This will fetch the records between the start date and end date.
However i need to get the count of the records. Appreciate a little help here. Thank you.
I’m not sure but into frappe-bench/apps/frappe/frappe/database/database.py the count method don’t manage the filters as get_all method do. “between” sql trick seems not possible.
May be old school way, something like
{[‘date’ ,‘>=’, ’ from_date’],[‘date’ ,‘<=’, ‘to_date’]}
?