Hi all ,
I need a report which displays the subtracted amount from two column from 2 different tables whcih are not related.
table A and B.
Table A has amt_paid column and table B has total_amt column....amt_paid should be substracted from total amount and displayed in the reports. These 2 tables (A&B) has REv_Acct_code & date as common columns. Teh user enteres the date for that entered date it should subtract the (total_amount)-(amount_paid) and display along with rev_acct_code.
v.totamtpd - p.pw_amount amount
from vw_payin_line v, payin_withdrawal p
this is what I worte.....vw_payin_line table & payin_withdrawal table are not related....but they do have a common field between them rev_acct_code & dates are common.....so the above query should give me 13 records....becoz there are 13 records....but this query gives me 39 records.....i.e everything gets repeated...
so on.....becoz there are 3 records in payin table with that criteria...& 13 records in vw_payin with that criteria...its mutiplying & diaplying whcih is wrong....13*3=39 records....
Is this becoz the tables r not related?