Skip to Content
0
Former Member
Jun 11, 2007 at 07:40 AM

regarding sum

19 Views

Post Author: prasadkambala

CA Forum: Formula

Hi,

I have 3 tables named Account,Debit,Credit

IN account table accountId is the primary key, so the table contains data like

ACCOUNTID

11111

22222

33333

44444

In debit and credit tables ACCOUNTID is not primary key,so these table contain data like

DEBIT TABLE CREDIT TABLE

DEBIT.ACCOUNTID DEBIT.AMOUNT CREDIT.ACCOUNTID CREDIT.AMOUNT

11111 20000 33333 30000

11111 30000 33333 10000

now my requirement is, i want to create a formula feild which sums

if(ACCOUNT.ACCOUNTID=DEBIT.ACCOUNTID) then sum(DEBIT.AMOUNT)

else if(ACCOUNT.ACCOUNTID=CREDIT.ACCOUNTID) then sum(CREDIT.AMOUNT)

When i use this formula it is not displaying any rows.

It should print like

ACCOUNTID AMOUNT

11111 5000033333 40000

please slove my problem.

Thanks in advance.