Excluding certain results from a query
Hi folks. I have a database with a date field where the dates are stored in a format like yyyy-mm-dd. I want my users to be able to search the entire date range but exclude results from certain years. Here's the query I've got:
How should I rewrite this to get the effect of
$query = "select * from table where date like \"%$trimmed%\" order by date";
Thanks greatly for your help.
$query = "select * from dailies where date like \"%$trimmed%\" (EXCEPT IF DATE IS 1980-06 to 1980-12) order by date";