Показать сообщение отдельно
Старый 02.07.2009, 12:58   #3  
Silphidae is offline
Silphidae
Участник
 
96 / 15 (1) ++
Регистрация: 17.11.2008
Огромное спасибо, Twilight.
Все работает. Конечный вариант выглядит так:
X++:
    while select inventTable
        where inventTable.ItemGroupId == "41.01.00" ||
              inventTable.ItemGroupId == "43.00.00"
    {

        select sum(PostedQty),sum(PostedValue) from inventSum
                    where inventSum.ItemId      == inventTable.ItemId   &&
                          inventSum.Closed      == NoYes::No;
                          
        costPrice = inventSum.PostedQty ? inventSum.PostedValue / inventSum.PostedQty : 0;

        if(costPrice > )
            info(strfmt("itemId = %1, costPrice = %2", inventTable.ItemId, costPrice));
    }