corrección
SELECCIONAR LA TAPA 50 * DE (
SELECCIONAR InvMovements.TrnYear, InvMovements.TrnMonth, InvMovements.StockCode,
InvMaster.Description, InvMovements.Customer, suma (InvMovements.TrnQty) TrnQty,
Suma (InvMovements.TrnValue) TrnValue, suma (InvMovements.CostValue) CostValue,
Suma (InvMaster.MaterialCost * InvMovements.TrnQty) COMO material,
Suma (InvMaster.LabourCost * InvMovements.TrnQty) COMO trabajo,
Suma (InvMaster.SubContractCost * InvMovements.TrnQty) COMO OSP,
Suma (InvMaster.VariableOverhead * InvMovements.TrnQty) COMO VOH,
Suma (InvMaster.FixOverhead * InvMovements.TrnQty) COMO FOH,
suma (InvMovements.TrnValue - InvMovements.CostValue) COMO margen,
De InvMaster InvMaster INTERNO ENSAMBLAR
InvMovements InvMovements EN InvMaster.StockCode = InvMovements.StockCode
DONDE (InvMovements.MovementType = “S ") Y (InvMovements.TrnYear = 2010) Y (InvMovements.TrnMonth = 6)
GRUPO POR InvMovements.TrnYear, InvMovements.TrnMonth, InvMovements.StockCode,
InvMaster.Description, InvMovements.Customer
) SQ
ORDEN POR el desc de TrnValue