Jump to content

date formatting


Nodral

Recommended Posts

Hi

 

I am running a query which should only pull back the year from my DB table, however I am getting a list of null results

 

My query is SELECT YEAR('Date') as year FROM courses

 

and my data is

 

ID            EMPNO    Coursename                                              Date

1389 429 NFR Returns                                 2007-06-12 10:00:00

1390 429 Age Discrimination Conference Call 2006-09-13 14:00:00

1391 429 HOME Getting More Out Of Your Day 2007-09-07 09:30:00

1392 429 Pivotal Launch                                 2005-04-21 10:00:00

1393 429 Coaching for Improved Performance 2005-05-25 09:30:00

 

ANy ideas?  I only need to return the date from this

 

Date is set as a DateTime data type

Link to comment
https://forums.phpfreaks.com/topic/252138-date-formatting/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.