SELECT SUM(A+B) AS SumTotal FROM TABLE WHERE OrderID = '1'
Date :
2009-02-05 22:07:01
By :
webmaster
No. 2
Guest
SELECT VE.[Item Ledger Entry No_],Max(VE.[Item No_]) as [Item No_],
Max(VE.[Entry No_]) as [Entry No_],
Max(VE.[Posting Date]) as [Posting Date],
Max(VE.[Item Ledger Entry Type]) as [Item Ledger Entry Type],
Max(VE.[Document No_]) as [Document No_],Max(VE.Description) as Description,
Max(VE.[Location Code]) as [Location Code],Max(VE.[Source No_]) as [Source No_],
Max(VE.[Inventory Posting Group]) as [Inventory Posting Group],
Max(VE.[Valued Quantity]) as [Valued Quantity],
Sum(VE.[Cost per Unit]) as [Cost per Unit],
Sum(VE.[Cost Amount (Actual)]) as [Cost Amount (Actual)]
FROM [Value Entry] VE With (Nolock)
Inner join dbo.[Item Ledger Entry] ITE With (Nolock)
on VE.[Item No_]=ITE.[Item No_] and VE.[Document No_]=ITE.[Document No_]
and VE.[Item Ledger Entry No_]=ITE.[Entry No_] Inner join
dbo[Production Order] PRO With (Nolock)
On VE.[Document No_]=PRO.[No_]
Where ITE.[Item Category Code] in ('RM','SEMI') AND (VE.[Item Ledger Entry Type] = 5)