Hello again, I think this is another issue with me using Unixtime which I'm starting to regret.
I would like to select a distinct year and month from my list of file attachments, shown nyah:
Untitled-1.jpg
These dates I believe all fall between November 4 and 5, 2011.
I have tried:
Which returns:Code:SELECT DISTINCT UNIX_TIMESTAMP( YEAR( date_created ) ) AS yyear, UNIX_TIMESTAMP( MONTH( date_created ) ) AS mmonth FROM posts WHERE post_type = 'attachment' ORDER BY date_created DESC LIMIT 0 , 30
yyear = 0
mmonth = 0
Which returns the same, and:Code:SELECT DISTINCT YEAR( UNIX_TIMESTAMP( date_created ) ) AS yyear, MONTH( UNIX_TIMESTAMP( date_created ) ) AS mmonth FROM posts WHERE post_type = 'attachment' ORDER BY date_created DESC LIMIT 0 , 30
Which returns:Code:SELECT DISTINCT YEAR( date_created ) AS yyear, MONTH( date_created ) AS mmonth FROM posts WHERE post_type = 'attachment' ORDER BY date_created DESC LIMIT 0 , 30
yyear = Null
mmont = Null
In this cast I am expecting 2011 and November so I'm obviously doing something wrong but not sure what. Any help would be appreciated.



Reply With Quote




Bookmarks