SELECT COUNT(DISTINCT(a.id)) as total FROM event a  LEFT JOIN event_date c on (c.event_id = a.id)  WHERE 1 AND DATE_FORMAT(c.date,'%Y-%m-%d')= DATE_FORMAT ('2020-01-28 18:31:26','%Y-%m-%d') AND a.online=1 AND a.date_online <= '2020-01-28 18:31:26'
FUNCTION lacid_www.DATE_FORMAT does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual