i want to add arrears(balance into next month arrears when i insert new month fees.please review the attached query;
INSERT INTO Fees ( [GR No], Class, Tuition, FMonth, TMonth, [year], Transport,arrears)
SELECT [Fee Student].[GR No], [Fee Student].Class, [Fee Student].Tuition*2 AS Tuition, [fee insert].FMonth, [fee insert].TMonth, [fee insert].year, [Fee Student].Transport, Arrears
FROM [fee insert], [Fee Student];
For Example:
May-May: Total fees=10000 Paid=9000 Arrears = 0 Balance=1000
Jun-Jul: Total fees=10000 Paid=8000 Arrears = 1000 Balance=3000
Now want to insert that month and want to insert arrear with total fees. please help me in this regards:
Aug-Sep: Total fees=10000 Paid= Arrears = 3000 Balance=
Slight chnages in that query: please also review that:
INSERT INTO Fees ( [GR No], Class, Tuition, FMonth, TMonth, [year], Transport, Arrears )
SELECT [Fee Student].[GR No], [Fee Student].Class, [Fee Student].Tuition*2 AS Tuition, [fee insert].FMonth, [fee insert].TMonth, [fee insert].Year, [Fee Student].Transport, (admission+registration+security+annual+id+exam+stationary+tuition+fees.transport)-paid AS Expr1
FROM [fee insert], Fees INNER JOIN [Fee Student] ON Fees.[GR No] = [Fee Student].[GR No];
INSERT INTO Fees ( [GR No], Class, Tuition, FMonth, TMonth, [year], Transport,arrears)
SELECT [Fee Student].[GR No], [Fee Student].Class, [Fee Student].Tuition*2 AS Tuition, [fee insert].FMonth, [fee insert].TMonth, [fee insert].year, [Fee Student].Transport, Arrears
FROM [fee insert], [Fee Student];
For Example:
May-May: Total fees=10000 Paid=9000 Arrears = 0 Balance=1000
Jun-Jul: Total fees=10000 Paid=8000 Arrears = 1000 Balance=3000
Now want to insert that month and want to insert arrear with total fees. please help me in this regards:
Aug-Sep: Total fees=10000 Paid= Arrears = 3000 Balance=
Slight chnages in that query: please also review that:
INSERT INTO Fees ( [GR No], Class, Tuition, FMonth, TMonth, [year], Transport, Arrears )
SELECT [Fee Student].[GR No], [Fee Student].Class, [Fee Student].Tuition*2 AS Tuition, [fee insert].FMonth, [fee insert].TMonth, [fee insert].Year, [Fee Student].Transport, (admission+registration+security+annual+id+exam+stationary+tuition+fees.transport)-paid AS Expr1
FROM [fee insert], Fees INNER JOIN [Fee Student] ON Fees.[GR No] = [Fee Student].[GR No];
Last edited: