SQL Query Question

I'm using the below query to pull forum posts into Matrix.

    										  SQL Query																													SELECT  last_poster_name, title, tid, last_post,  DATE_FORMAT(FROM_UNIXTIME(last_post), '%y/%m/%d')AS last_post FROM  ibf_topics ORDER BY last_post


These posts get created as shadow assets within Matrix, but because I am setting the date format as y/m/d when these forum posts are printed to the page I have a naff date format.

If I change the date format in the SQL query then the shadow assets are listed out of order, and the order the shadow assets are in appears to determine how they are printed onto the page.

My question is, can I intercept the date before it gets printed to the page and convert it to a user-friendlier format?

Why not select the last_post field twice and sort by the unmodified version:

[sql]SELECT last_poster_name, title, tid, last_post as last_post_sort, DATE_FORMAT(FROM_UNIXTIME(last_post), '%y/%m/%d') AS last_post FROM ibf_topics ORDER BY last_post_sort DESC[/sql]

That should work. :)

[quote]Why not select the last_post field twice and sort by the unmodified version:


[sql]SELECT last_poster_name, title, tid, last_post as last_post_sort, DATE_FORMAT(FROM_UNIXTIME(last_post), '%y/%m/%d') AS last_post FROM ibf_topics ORDER BY last_post_sort DESC[/sql]



That should work. :)[/quote]



It sure does, many thanks for your help.


You're welcome. :)