Hi All
I am Using 2 Tables (1 Table is Fees_Transaction another one Table is FeesMaster). I Want to JOIN 2 Talbe and Matching the Class and Regno From that Amount Shoud be Calculate and Display in the DataGridView.
I Try to This Code but it's notWorking... Please Help me.. How to Join and Caluclate Particular regno+Class amount.
Fees_Transaction Table Data
Regno ST_Name Class Section Amount_Paid FeeType
A600 BBBB I A 500 Team-1
A900 PPPP I A 750 Team-1
A700 DSDSDSDSD I A 500 Team-1
A700 DSDSDSDSD I A 250 Team-1
A700 DSDSDSDSD I A 300 Jan
A700 DSDSDSDSD I A 350 Jan
A600 BBBB I A 150 Team-1
A900 PPPP I A 200 Jan
FeesMaster : Table Data
Reg no Class Section Sname FeeType FeeAmount
A600 I A BBBB Team-1 650
A700 I A DSDSDSDSD Team-1 750
A900 I A PPPP Team-1 750
A600 I A BBBB Jan 650
A700 I A DSDSDSDSD Jan 650
A900 I A PPPP Jan 650
I WANT LIKE THIS IN DATAGRIDVIEW
Reg no ST_Name Amount_Paid FeeAmount FeeType Class Section
A600 BBBB 650 1300 TOTAL I A
A700 DSDSDSDSD 1400 1400 TOTAL I A
A900 PPPP 950 1400 TOTAL I A
Dim strSQL5 As String = "SELECT Fees_Transaction.Regno, Fees_Transaction.ST_Name, SUM(Fees_Transaction.Amount_Paid) as FTAmountPaid, FeeAmount FROM Fees_Transaction INNER JOIN (SELECT Class, SUM(FeeAmount) FROM FeesMaster WHERE FeesMaster.Class='" & cboClass.Text & "') as FeeAmount WHERE Fees_Transaction.Class='" & cboClass.Text & "' GROUP BY Fees_Transaction.Regno,Fees_Transaction.ST_Name"