Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DATE_FORMAT Problems

Status
Not open for further replies.

Nematoth

Programmer
Mar 29, 2002
48
MY
I am currently building a project management system in PHP and MySQL but am having problems formatting the date correctly. As a test I have manually inserted values into a date column in one of my tables. Looks like this: 2002-12-19.

When I do this:

SELECT project_number, project_name, description, DATE_FORMAT('start_date', '%d/%m/%y') AS Start_date, completion_date, status FROM project;

The result returned in the Start_date columm is NULL....

Any ideas why this might be happening?

Cheers! Thomas Shearer
Multimedia Developer
 
I have just figured it out....doh!
Is there any way to remove these posts so I don't look totally dumb!!! haha...

I removed the '' wrapping the column name. i.e:

SELECT project_number, project_name, description, DATE_FORMAT(start_date, '%d/%m/%y') AS Date_started, completion_date, status FROM project;

Please remove this thread.... Thomas Shearer
Multimedia Developer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top