Is it possible to add or condition in get_value
date = frappe.db.get_value( “Leave Statement”, { “employee”: ‘EMP-00001’, “leave_type”: ‘Annual Leave’, “type”: “Assignment” Or “type”:“Accrual” }, “MAX(posting_date)” )
"type": "Assignment" Or "type":"Accrual"
Atlernatively you can use frappe.db.sql
date = frappe.db.sql( """ SELECT MAX(posting_date) FROM `tabLeave Statement` WHERE employee = %s AND leave_type = %s AND (type = %s OR type = %s) """, ('EMP-00001', 'Annual Leave', 'Assignment', 'Accrual') )
is any option in rappe.db.get_value
check this one
date = frappe.db.get_value( "Leave Statement", { "employee": 'EMP-00001', "leave_type": 'Annual Leave', "type": ["in", ["Assignment", "Accrual"]] }, "MAX(posting_date)" )
Thanks for the support