Situation
Query error when trying to add a recall for a patient.
OpenEMR Version
I’m using OpenEMR version 5.0.1(7)
Browser:
I’m using: Firefox or Chrome - reproducible with both
Operating System
I’m using:
Logs
Yes
ERROR: query failed: SELECT * FROM openemr_postcalendar_events AS cal LEFT JOIN patient_data AS pat ON cal.pc_pid=pat.pid WHERE cal.pc_eventDate = curdate() - interval 0 daycal.pc_eventDate <= curdate() - INTERVAL 0 DAY AND cal.pc_eventDate > (curdate() - INTERVAL '3' DAY) AND cal.pc_apptstatus in (?) AND cal.pc_aid in (?) AND cal.pc_facility in (?) AND cal.pc_pid NOT in ( SELECT msg_pid from medex_outgoing where campaign_uid =? and msg_date >= curdate() ) AND cal.pc_eid NOT IN ( SELECT DISTINCT msg_pc_eid from medex_outgoing where campaign_uid=? and msg_date >= curdate() ) ORDER BY cal.pc_eventDate,cal.pc_startTime
Error: 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 'daycal.pc_eventDate <= curdate() - INTERVAL 0 DAY AND ' at line 5
/var/www/localhost/htdocs/openemr/library/MedEx/API.php at 1020:sqlStatement
/var/www/localhost/htdocs/openemr/library/MedEx/API.php at 3545:generate(KcMVk8KfjA1QQfUtYa3oivnX5TupszI9,Array)
/var/www/localhost/htdocs/openemr/library/MedEx/API.php at 3579:just_login(Array)
/var/www/localhost/htdocs/openemr/interface/main/messages/messages.php at 50:login()```