on 11-25-2010 6:42 AM
Hello all,
this is regarding calling the subroutine in the script.
I have a field balance carried amount with name SALDO and a filed with name WRSHB(may be either credit or debit).
Everytime i have to calculate the balance amount depending upon the credit and debit amount.
on first iteration, carried amount+credit = B1.
on second iteration , B2 = B1+debit .
on third iteration, B3 = B2 + Credit.
So on.....
but in this carried amount field,SALDO is unique on first iteration and later it will not be in the scope of balance calculation.
i.e first time i have to calculate the balance amount from SALDO and credit amount and from next time onwards i have to calculate the balance from the balance that i got in the previous step and then add that to credit or debit amount.
How can i approach this using subroutine.
Thanks in advance.
Hi,
Can you check B1 for the first time it would be blank so if it is blank so if that is blank use the carried amount fromt eh second time onwards there would be some value in B1 then do not use it.
So pass the values of carried amount and the other two fields and inside the subroutine check if the B1 amount is blank if it is blank add the value of carried amount other wise do not.
Regards,
Himanshu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You pass outstanding amt after each pass into a variable v_bal and calculate balance :
v_bal = v_bal + v_amt.
Clear that v_bal for every new customer/vendor.
Thanks and Regards,
Chandra
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.