Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'and subtype=2 and (`from` < '2019-02-21' and `to` >'2019-02-21')' at line 1