built dynamic query, add default value for year