A Database Error Occurred

Error Number: 1064

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 a.Weekend_Flag=1 AND a.start_date <= Now() And (a.end_date Is Null OR a.end_' at line 4

SELECT a.*, SUBSTRING(a.time, -2, 2) as ampm FROM (tbl_masstimes a) LEFT JOIN tbl_masscancellation b ON a.ID = b.MasTimeID WHERE a.diocese_id=5 AND a.OrganizationID= AND a.Weekend_Flag=1 AND a.start_date <= Now() And (a.end_date Is Null OR a.end_date > Now()) ORDER BY a.day desc, a.masstime, ampm