I have a query that i need to get only the rows that are for the current year.
The column that has the unix time is referrals.entered
here is the current query:
SELECT referrals.*, to_person.fname as to_fname, to_person.lname as to_lname, from_person.fname as from_fname, from_person.lname as from_lname FROM referrals LEFT JOIN person as from_person ON (from_person.ID = referrals.from_ID) LEFT JOIN person as to_person ON (to_person.ID = referrals.to_ID) LEFT JOIN chapter_relation as from_relation ON (from_person.ID = from_relation.person_ID) LEFT JOIN chapter_relation as to_relation ON (to_person.ID = to_relation.person_ID) WHERE from_relation.chapter_ID = to_relation.chapter_ID AND from_relation.chapter_ID = '$chapterid' ORDER BY referrals.entered DESC