Hi guys i am trying to get last 7 days closed tickets from table Here is the query i have wrote
'closed' => new Zend_Db_Expr('SUM(IF(rt.assignee_id IS NOT NULL,IF(rt.status_id = 24,1,0),0))')
can any one help me how can i add my condition inside IF?
Thanks in advance.
'closed' => new Zend_Db_Expr('SUM(IF(rt.assignee_id IS NOT NULL, IF(rt.status_id = 24, IF(created >= CURDATE() - INTERVAL 7 DAY, 1,0),0),0))')
not 100% sure about the
CURDATE() - INTERVAL 7 DAY
, but i think you will understand it.