I am pulling the date from the DB and converting the unix time in to a readable date.

What I would like to do is get the MAX date, and then GROUP. but cannot see I how can get MAX date in the query when using from_unixtime

Below is the orginal part of the query which works
from_unixtime(tb1.date, "%b %D %Y" ) as date

Below is the original query with MAX included, which creates a MySQL error
from_unixtime(MAX(tb1.date, "%b %D %Y" )) as date

    max(from_unixtime()) or from_unixtime(max(), format)

    Not sure if the second is actually valid sql, even though it's valid for from_unixtime. i'd go with the first one anyway.

      Thank you I will give those ones a go.

        Write a Reply...