In chart account table
glaccount nametext
1204005 BAH - Khay
2202013 Sales Tax Payable New
2019384 Generator
1848485 Vechicle
and in other table
this glaccount is in account table and this glaccount is unique values
acdocno glaccount docamount glnametxt
0600000307 1204005 363538 BAH - Khay
0600000307 2202013 56003 Sales Tax Payable New
0600000307 1201001 456023 Accounts Receivable
0600000307 1201001 456023 Accounts Receivable
0600000307 1206004 36482 Adv Income Tax -
'
except 1204005 all glacct is fixed only 1204005 is change when acdocno change
so how i get this glaccount amount i.e. 363538 in crystal report.. when i only drag field docamout then 456023 is displayed and i want this value 363538
current data in report
Acdocno Total Amount Bank Amount Bank Name
0600000307 456,023.00 456,023.00 Accounts Receivable
and i want
Acdocno Total Amount Bank Amount Bank Name
0600000307 456,023.00 363538 BAH - Khay
What I have tried:
query which i tried
select distinct
acdocdtl.acdocno,
acdocdtl.docamount,glchaact.glnamestxt
from acdocdtl
inner join acdochdr
on
acdocdtl.acdocno =acdochdr.acdocno
and acdocdtl.cocode=acdochdr.cocode
left join glchaact
on acdocdtl.glacct = glchaact.glacct
and acdocdtl.chaact=glchaact.chaact
where acdocdtl.acdocno='0600000307'
how i done this