Irmantukas1 rašė:
Labas vakaras Niemand. Prekių nurašymo akte, kažkodėl vienai prekei iš 9 išmeta klaidą ir neleidžia jos įkelti. Kame gali būti problemos?
Per Bendras\Query browser įvykdykit šituos sakinius (po vieną) ir atsiųskit rezultatą:
SELECT GoodsID, OperationType, WarehouseID, MAX(OperationDate), 0 FROM goodsoperations WHERE GoodsID=11 GROUP BY GoodsID, OperationType, WareHouseID UNION SELECT GoodsID, 13, 0, MAX(ChangeDate), 0 FROM goodsvaluationmethods WHERE GoodsID=11 GROUP BY GoodsID UNION SELECT GoodsID, AccountType, 0, MAX(ChangeDate), 0 FROM goodsaccounts WHERE GoodsID=11 GROUP BY GoodsID;
SELECT GoodsID, OperationType, WarehouseID, OperationDate, 0 FROM goodsoperations WHERE GoodsID=11 GROUP BY GoodsID, OperationType, WareHouseID UNION SELECT GoodsID, 13, 0, ChangeDate, 0 FROM goodsvaluationmethods WHERE GoodsID=11 GROUP BY GoodsID UNION SELECT GoodsID, AccountType, 0, ChangeDate, 0 FROM goodsaccounts WHERE GoodsID=11 GROUP BY GoodsID;