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 (WebExam.ExamID = '' ) AND ((WebExamCourseDates.isPublished)=1) AND ((WebE' at line 3

SELECT Distinct WebExamCourseDates.ExamID, WebExam.Title as WebName FROM WebExamCourseDates INNER JOIN WebExam ON WebExamCourseDates.ExamID = WebExam.ExamID WHERE (((WebExamCourseDates.ProviderID)=) AND (WebExam.ExamID = '' ) AND ((WebExamCourseDates.isPublished)=1) AND ((WebExamCourseDates.ExamDate)>=CurDate())) ORDER BY WebExam.Title