Query Problem

mfaisal.ce

Member
Local time
Today, 20:04
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
 
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

Back
Top Bottom