Database query failed: Incorrect DATE value: ''

Last SQL query: SELECT g.id AS game_id, gp.team_id, g.phaze_id, p.name AS phase_name, p.type AS phase_type, g.comp_id as comp_id, cmp.name AS comp_name, s.name AS sport_name, t.name, c.image, g.name AS gname, g.group, gp.score, g.type AS game_type, loc.name as location, g.time, g.status, g.period_id, t.is_guest, g.davis, g.submatch, cmp.ghost_play as in_play FROM games AS g INNER JOIN game_participants AS gp ON gp.game_id = g.id INNER JOIN teams AS t ON gp.team_id = t.id INNER JOIN clubs AS c ON t.club_id = c.id INNER JOIN competitions AS cmp ON g.comp_id = cmp.id INNER JOIN phazes AS p ON p.id = g.phaze_id INNER JOIN sports AS s ON s.id = cmp.sport_id LEFT JOIN location AS loc ON loc.id = g.location WHERE g.type!='DAVIS' and DATE(g.time) = '' AND cmp.season_id = 19 AND cmp.sport_id = 21 ORDER BY g.time ASC, location, g.group DESC, g.id, gp.id