List:General Discussion« Previous MessageNext Message »
From:PAUL MENARD Date:January 5 2004 4:25pm
Subject:RE: Issue with DATE_FORMAT() call returning wrong year
View as plain text  
I just saw thay in the online documentation. Sometimes it help to read the manual before
posting. 
 
Sorry.


stairwaymail-mysql@stripped wrote:
Try %Y instead of %X

-----Original Message-----
From: PAUL MENARD [mailto:fpm@stripped]
Sent: Monday, January 05, 2004 10:08 AM
To: mysql@stripped
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/mysql?unsub=1

Thread
Issue with DATE_FORMAT() call returning wrong yearPAUL MENARD5 Jan
RE: Issue with DATE_FORMAT() call returning wrong yearstairwaymail-mysql5 Jan
  • RE: Issue with DATE_FORMAT() call returning wrong yearPAUL MENARD5 Jan