i have 2 tables
create table Chart_of_Account (Head Varchar2(25),Code number(15),Name varchar2(25),phone varchar2(20),Amount number(12),Debit number(20),Credit number(20));Create table Accounts Sr_no number(10),Cdate Date,COde number(10),Name varchar2(25),Naration Varchar2(25),Amount number(15),Debit number(15),credit number(15));
From chart_of_account i enter party names ... Ok? with different heads... Like
1) Assets
2)Cash
2)Borrow
etc in List_item with their opening balance ... that balance go to "Accounts" table Column debit or credit...
now i need query to show total balance of Assets and every head
Suppose i enter 10 parties into AChart_Of_account i pick the name into accounts table with LOV from chart_of_account....
now need total balance like this
Assets 10009999 if total accounts debit -credit=debit
Boorow 9977777 if total accounts debit -credit=debit