Click here to Skip to main content
15,885,933 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to sum into 2 columns from same table with different where conditions in MS Access?
----------------------------------------------------------------------------------------------------
I tried this query:
SQL
SELECT 
SUM(TrfRoomData.BillAmount) AS Expr1,
SUM(TrfRoomData.BillAmount) AS Expr2 
FROM TrfRoomData  
INNER JOIN FinalBillData on FinalBillData.Regno=TrfRoomData.RegNo 
WHERE (TrfRoomData.Head = 'Room Rent') 
GROUP BY   TrfRoomData.RegNo"
Posted
Updated 27-Jun-15 23:29pm
v2
Comments
OriginalGriff 28-Jun-15 4:23am    
It's not that obvious exactly what you are trying to do: this isn;t complex, I suspect, but since your example only shows one condition, and you say you are looking for two, we don't know what kind of results you want.

Perhaps if you gave us input and output examples, that might help?
Use the "Improve question" widget to edit your question and provide better information.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900