date_format help

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
will83
Forum Commoner
Posts: 53
Joined: Thu Nov 10, 2005 3:13 pm

date_format help

Post by will83 »

Hi,

I am trying to pull dates out of a table and convert them to a different format.

However it's not working:

Code: Select all

$query = mysql_query("SELECT link_log.date_format(date,'%W, %M %D, %Y.') 
FROM link_log INNER JOIN link_company ON  link_log.company_id = link_company.id 
WHERE 1") or exit(mysql_error());

It is simply outputing nothing.

Do you think that it's not working becase it is in a join select?

Thanks

Will
User avatar
will83
Forum Commoner
Posts: 53
Joined: Thu Nov 10, 2005 3:13 pm

Post by will83 »

In answer to myself:

Code: Select all

$query = mysql_query("SELECT date_format(link_log.date,'%W, %M %D, %Y.') 
FROM link_log INNER JOIN link_company ON  link_log.company_id = link_company.id 
WHERE 1") or exit(mysql_error());
thanks me
Post Reply