jboy6t9 Posted June 7, 2007 Share Posted June 7, 2007 hi.. i am using dreamweaver 8.2, php and mySQL db. my questions is how can i filter a set of records on the date field by only giving the YEAR as the variable. what i want to achieve is a list of listings by year. please could someone help. i tried this but no luck SELECT * FROM tblProperties WHERE dateAdded LIKE '%2006' Quote Link to comment https://forums.phpfreaks.com/topic/54538-solved-select-statement-on-date-field-by-specific-year/ Share on other sites More sharing options...
trq Posted June 7, 2007 Share Posted June 7, 2007 What field type is dateAdded? Quote Link to comment https://forums.phpfreaks.com/topic/54538-solved-select-statement-on-date-field-by-specific-year/#findComment-269762 Share on other sites More sharing options...
jboy6t9 Posted June 7, 2007 Author Share Posted June 7, 2007 its is a date data type Quote Link to comment https://forums.phpfreaks.com/topic/54538-solved-select-statement-on-date-field-by-specific-year/#findComment-269782 Share on other sites More sharing options...
trq Posted June 7, 2007 Share Posted June 7, 2007 SELECT * FROM tblProperties WHERE YEAR(dateAdded) = '2006'; Quote Link to comment https://forums.phpfreaks.com/topic/54538-solved-select-statement-on-date-field-by-specific-year/#findComment-269784 Share on other sites More sharing options...
jboy6t9 Posted June 7, 2007 Author Share Posted June 7, 2007 thank you so much for the quick response.. its been bugging me for 2 hrs! IT WORKS! Quote Link to comment https://forums.phpfreaks.com/topic/54538-solved-select-statement-on-date-field-by-specific-year/#findComment-269790 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.