I'm trying to get subscriptions ending in a given month using the DB API documented here.
I can get before a certain date with:
end_period = datetime.date(2020, 12, 31)
frappe.db.get_list('Subscription', filters={
'current_invoice_end': ['<', end_period]
})
But how would I specify before end_period
and after start_period
?
When I tried
frappe.db.get_list('Subscription', filters={
'current_invoice_end': ['<', end_period],
'current_invoice_end': ['>', start_period]
})
It treated it as "OR" and listed things outside of the range.
cross-posted at discuss.erpnext.com