i have below query which i want to use in my application using nodejs i ran this query in mysql works fine but when i am running this query in application it's giving below error. Any help would be appreciated.
SELECT COUNT(*) as nos, t.* FROM
streams,
trackt WHERE s.type = 1 AND s.createdAt <= 2018-07-01' AND s.createdAt >= '2018-06-01' AND t.type = 'audio' AND s.track = t.id GROUP BY s.track Order BY nos DESC, createdAt DESC LIMIT 50
error: Sending 500 ("Server Error") response: { Error: ER_PARSE_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 s.createdAt >= '2018-06-01' AND t.type = 'audio' AND s.track = t.id GROUP ' at line 1