Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.