how to search year through query?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
adilmarwat2004
Forum Commoner
Posts: 44
Joined: Fri Sep 04, 2009 11:28 pm

how to search year through query?

Post by adilmarwat2004 »

I have table name merit and has four fields as

roll, name, marks, date_retire(date).
2 Neil 326 02-06-2015
3 Jhon 312 06-11-2013


I want to use query like that which Select date_retire by year not day or month.

please help
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: how to search year through query?

Post by Christopher »

Something like "SELECT * FROM merit WHERE YEAR(date_retire)='$year' " ?
(#10850)
Post Reply