fix date query