Jump to content

Date Formatting (again)


Nodral

Recommended Posts

Hi All

 

Any ideas what is wrong with this query?

 

SELECT count(*) as number WHERE ed = 429 AND YEAR(StartDate) = '2007'

 

Data is as below

 

ID            ED          CourseName                                            StartDate

1405 429 In Search of Promoters                 2011-02-01 10:00:00

1406 429 Managing the Customer Experience 2011-02-15 09:30:00

1407 635 Driver Awareness                                 2009-12-08 09:00:00

1408 635 Time Management                                 2007-03-23 10:00:00

1409 635 Fleet Administration                                 2005-04-13 10:00:00

1410 635 Coaching and Counselling Skills 2004-04-06 10:00:00

 

Error Code: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE ed = 429 AND YEAR(StartDate) = '2007'' at line 1

 

Link to comment
https://forums.phpfreaks.com/topic/252220-date-formatting-again/
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.