My name is Muhammad irfan ansari, from Pakistan.
I am working on an Account maintain software.
This had some tables and store proc and views for crystal report.
I am making this software for a shop where some costumer comes and buy some things, and then they paid some money and some money not given by them, they said I will pay after some days.
Example:-
Original table or records are Bellow
Namee Buy _date Bought _some _cloth paid _money remaining _balance
Jon 10/08/2010 30000 10000 20000
Ali 23/08/2010 10000 2000 8000
Ali 14/08/2010 20000 12000 8000
Jon 8/08/2010 50000 20000 30000
Salvia 30/08/2010 100000 50000 50000
Salvia 19/08/2010 20000 20000 0
Ali 10/08/2010 10000 10000 0
And I want to record like this. Mean when I select one particular record so it should be like this as bellow.
Namee Buy_ date Bought _some_ cloth paid _money Remaining_ balance
Jon 10/08/2010 30000 10000 20000
Jon 11/08/2010 50000 20000 30000
Total reaming balance
50000
Please tell me how it possible?
I tried it as in SQL server query.
Select name,buy_date,sum(Remaining _balance) from table1
where name=’jon’
Group by nmaee,buy_date
When I tried this so result as bellow, see
Namee Buy_ date Bought _some_ cloth paid _money Remaining_ balance
Jon 10/08/2010 30000 10000 20000
Jon 11/08/2010 50000 20000 30000
Not give total as this is
Namee Buy_ date Bought _some_ cloth paid _money Remaining_ balance
Jon 10/08/2010 30000 10000 20000
Jon 11/08/2010 50000 20000 30000
Total reaming balance
50000