Query Problem (1 Viewer)

mfaisal.ce

Member
Local time
Today, 04:21
Joined
Dec 21, 2020
Messages
76
Dear All,

I want to make a query but cant able to do that, plz help.....

I have 2 tables and i want to make a query to sum values...

Detail:

Sales Table
SNOBID
1222
2555
3333
4222
5333


Payment Table
PIDSNOTotalPaid
111000500
23500200
34900250
4420000
5530001000
6320002000
73100100
8550050
951000950
105200200
11250005000


Query Result
BIDTotalPaid
2223900750
33373004500
55550005000
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 09:21
Joined
May 7, 2009
Messages
19,169
Code:
SELECT [sales table].BID, Sum([payment table].Total) AS SumOfTotal,
Sum([payment table].Paid) AS SumOfPaid
FROM [payment table] LEFT JOIN [sales table]
ON [payment table].SNO = [sales table].SNO
GROUP BY [sales table].BID;
 

Users who are viewing this thread

Top Bottom