Query - TotalSalesAmt - TotalPurchaseAmt = Profit/Loss (1 Viewer)

sundaram

Registered User.
Local time
Today, 22:39
Joined
May 28, 2009
Messages
36
Dear Sirs,

SELECT TblTran.ItCode, TblTran.Item, TblTran.TUnit, Sum(TblTran.TQty) AS SumOfTQty, Avg(TblTran.TRate) AS AvgOfTRate, [sumofTqty]*[AvgofTrate] AS TotalAmt, TblTran.TTranscatType
FROM TblTran
GROUP BY TblTran.ItCode, TblTran.Item, TblTran.TUnit, TblTran.TTranscatType;


I have the table TblTran
Fields are ItCode, Item, Tunit,TQty,TRate and TTranscatType

Now question is that I need to get Profit or Loss with alias TotalSalesAmount and TotalPurchaseAmount.

Please help me out.

Thanks in advance.
RAJAMALLU
 

apr pillai

AWF VIP
Local time
Tomorrow, 00:09
Joined
Jan 20, 2005
Messages
735
You can use the above Query as source along with the Purchase Table joined on common ItemCode (.itCode)field and select all the fields from the Query and Purchase Value from the Table to calculate Profit/Loss.
 

Users who are viewing this thread

Top Bottom