From: James W. McNeely Date: February 13 2012 4:18pm Subject: weird difference in workbench and CLI query List-Archive: http://lists.mysql.com/mysql/226788 Message-Id: <1B98F9B7-60CA-410F-A9C9-2193FD139298@nwrads.com> MIME-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable When I run this query in workbench: select c.acc_number 'Accession Number', e.DateExam 'MBI Exam Date', = s.ExamDate 'SJH Exam Date' from chestcon_log c left join exams e on CONCAT("000",c.acc_number) =3D e.LastWordAccNum left join sjhreports_ s on c.acc_number =3D s.AccessionNumber WHERE=20 c.timestamp_exam <=3D CAST(DATE_ADD(CONCAT(CURDATE(), ' 23:59:59'), = INTERVAL '-1' DAY) AS DATETIME) AND c.timestamp_exam >=3D CAST(DATE_ADD(CONCAT(CURDATE(), ' 00:00:00'), = INTERVAL '-14' DAY) AS DATETIME) I get this: 7330565 NULL 2012-02-01 6604419 2011-01-25 NULL but when I run the same query in a shell script, on a Linux box or OS X, = I get this: 7330565 NULL 2012-02-01 6604419 NULL NULL I also tried echo this and piping it into MySQL with no shell script. = Same result. Why does the date eval to null in CLI?=