these are my databases
1. project

project_code| project_name |
20201 |Tanaman Padi |

2. account_name

an_account_code | an_account_name |an_project_code |
K6101 | PADI 1 |022020105 |
K6102 |PADI 2 |022020105 |
K6103 |PADI 3 |022020103 |



3. account_record

ar_account_record | ar_current_debit | ar_current_credit|
K6101 | 0 | 1000 |
K6102 | 0 | 2000 |
K6103 | 0 | 3000 |


the agregate query
bussiness volume = ar_current_credit - ar_current_debit

i would like to get this output

no| name | bussiness_volume|
1. | Tanaman Padi | 6000 |

this is what ive done
1. 'get name
sSQL = "select project_name, an_project_code from project, account_name
where project_code = substring(an_project_code,3,5)
and substring(an_project_code,3,2) = '20' "

2. 'get bussiness volume
select sum(ar_current_creddit-ar_current_debit) as bussiness_volume from
account_record where ar_account_code = rs1("an_acc_code")

this is the results
no | name | bussiness volume
1. |Tanaman Padi | 1000
2. | Tanaman Padi | 2000
3. | Tanaman Padi | 3000

what should i do?