Try %Y instead of %X -----Original Message----- From: PAUL MENARD [mailto:[EMAIL PROTECTED] Sent: Monday, January 05, 2004 10:08 AM To: [EMAIL PROTECTED] Subject: Issue with DATE_FORMAT() call returning wrong year
Hello all, I have a query that for some reason is now returning the incorrect year. First here is my server configuration. Windows 2003 Advanced server MySQL version 4.0.15-nt Here is my SQL statement: SELECT DATE_FORMAT(E.DateTime, '%X-%m-%d %h:%i:%s %p' ) AS DateTime, E.SendCount AS SendCount, E.TransactionStatus AS TransactionStatus, E.Message AS Message, TS.StatusDescription AS StatusDescription, TS.ErrorWarningInd AS ErrorWarningInd FROM errlog As E LEFT JOIN TransStatusTable AS TS ON E.TransactionStatus=TS.TransStatusCode WHERE AccountName='INSTILL000' AND Filename='SYSCO076_20040103125040.850' AND AccountScheduleDetailID=331 ORDER BY SendCount, DateTime, TransactionStatus The first column returned is the date. The values returned are such as '2003-01-03 02:50:16 PM' If I replace the DATE_FORMAT() call 'DATE_FORMAT(E.DateTime, '%X-%m-%d %h:%i:%s %p' ) AS DateTime' with a simple 'E.DateTime AS DateTime'. the returned value is now correct but the format is not. I have run this SQL statement from the mysql command line interface. I did initially use phpMyAdmin to see this. I just wanted to make sure this was not a PHP issue. Any thoughts? Paul -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]