select * from qryTradeRequests where upper(primaryPartnerName) like '%#ucase(url.keyword)#%' select oal.child_attrId from tbl_org_attributelinks oal with (nolock) where oal.mstr_attrTypeId = and oal.mstr_attrId = and oal.child_attrTypeId = and ( oal.linkRole = 'viewed-approved' or oal.linkRole = 'viewed-rejected' )