mysql - sql query: BETWEEN -


this question has answer here:

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

Popular posts from this blog

account - Script error login visual studio DefaultLogin_PCore.js -

xcode - CocoaPod Storyboard error: -