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 ot.date BETWEEN '1969-12-01' AND '1970-01-31' ORDER BY date ASC' at line 5
SELECT ot.id AS ot__id, ot.event_id AS ot__event_id, ot.date AS ot__date, ot.duration AS ot__duration, vt.id AS vt__id, vt.name AS vt__name, vt.contents AS vt__contents, ovt.id AS ovt__id, ovt.name AS ovt__name, ovt.contents AS ovt__contents, et.id AS et__id, et.calendar_id AS et__calendar_id, et.duration AS et__duration, et.active AS et__active 
		FROM `event_occurrences` as ot 
		LEFT JOIN `event_values` AS vt ON ot.event_id=vt.event_id 
		LEFT JOIN `event_occurrence_values` AS ovt ON ot.id=ovt.event_occurrence_id
		LEFT JOIN `events` AS et ON et.id=ot.event_id WHERE et.calendar_id= AND ot.date BETWEEN '1969-12-01' AND '1970-01-31' ORDER BY date ASC
<<TAMMIKUU>>
MaTiKeToPeLaSu
2829301234
567891011
12131415161718
19202122232425
2627282930311