1054 - Unknown column 'items_date_available_end' in 'where clause'

select distinct max(p.items_id), p.items_id, p.items_picture, p.items_tax_class_id, p.items_model, items_price from ((items p) left join specials s on p.items_id = s.items_id, items_to_categories p2c, categories c) where c.categories_status='1' and p.items_id = p2c.items_id and p2c.categories_id = c.categories_id and items_status = '1' AND (to_days(items_date_available_end) IS NULL OR (to_days(items_date_available_end) IS NOT NULL AND to_days(now()) <= to_days(items_date_available_end))) GROUP BY p.items_id order by p.items_date_added desc limit 9