while select filter { Fil = strfmt("(%1.%2 like \"%3\")", query.dataSourceTable(tablenum(inventTable)).name(), fieldstr(InventTable, ItemId), filter.filter); query.dataSourceTable(tablenum(inventTable)). addRange(fieldNum(InventTable, ItemId)).value(fil); }