return TermCodes query