View Full Version : DATE_FORMAT returning NULL

09-01-2006, 05:49 PM
Not sure why but I have an int field that hold a timestamp int and I know for a fact that my fields does not hold a null but when I run this query

select DATE_FORMAT(StartSec, '%Y-%c-%e') as Day from dates limit 5;

I get 5 records with NULL in them. What am I doing wrong?

Thank you for any help with this.

09-01-2006, 06:01 PM
Nevermind, I answered my own question with

select DATE_FORMAT(FROM_UNIXTIME(StartSec), '%Y-%c-%e') as Day from dates limit 5;

I needed to convert the int to a string first.