mysql - sql query: BETWEEN -
this question has answer here:
- mysql: select data between 2 dates 6 answers
i trying execute query between
data values.
i have seen questions here query more complicated.
this query:
select calendar.datefield date, ifnull( count( lead.insertdate ) , 0 ) task lead right join calendar on ( date( lead.insertdate ) = calendar.datefield ) , lead.lpid = '40' insertdate between '2016-01-05' , '2016-01-23' group date
i think problem in query syntax, query works until add where
row.
you have placed condition outside where
clause. try this.
select calendar.datefield date, ifnull( count( lead.insertdate ) , 0 ) task lead right join calendar on ( date( lead.insertdate ) = calendar.datefield ) insertdate between '2016-01-05' , '2016-01-23' , lead.lpid = '40' group date
Comments
Post a Comment