1. Да 2. Да 3. Да
X++:
query = new Query(querystr(myQuery));
qbdsItt = query.datasourcetable(tableNum(InventTransferTable));
qbdsIlFrom = query.datasourcetable(tableNum(InventLocation), 1);
qbdsIlTo = query.datasourcetable(tableNum(InventLocation), 2);
if (inventLocationType != InventLocationType::Standard)
{
qbrDataAreaId = qbdsIlTo.addRange(fieldNum(InventLocation, DataAreaId));
qbrDataAreaId.value(strFmt('((%1.%3 == %4) || (%2.%3 == %4))',
qbdsIlTo.name(),
qbdsIlFrom.name(),
fieldStr(InventLocation, InventLocationType),
any2int(inventLocationType)));
}
s = query.datasourceno(1).toString();
info(s);
queryRun = new QueryRun(query);
iRowCountTmp = SysQuery::countLoops(queryRun);
Какой запрос на SQL показать не смогу. У меня нет туда доступа
SELECT * FROM InventTransferTable JOIN * FROM InventLocation WHERE InventTransferTable.InventLocationIdFrom = InventLocation.InventLocationId JOIN * FROM InventLocation WHERE InventTransferTable.InventLocationIdTo = InventLocation.InventLocationId AND ((((InventLocationTo.InventLocationType == 8) || (InventLocationFrom.InventLocationType == 8))))