fixed sql query in year