Click to See Complete Forum and Search --> : Sum of Balance


Nagham
February 16th, 2007, 01:33 AM
Hi there,I'm using crystal report of VB.Net 2005,I have 3 columns in my report: Amount Credit,Amount Debit and Balance...in Balance I put 1000Cr if it's Credit or 1000Db...at the end I want to do the sum of those columns,no prob with Amount Credit and Amount Debit since their type is double,but the type of balance is string because of the letters 'Cr' or 'Db'...so how can I do this sum...I need if I have 1500Cr+2000Db that the sum be 500Db

1500 Cr
2000Db
sum 500Db

JaganEllis
February 17th, 2007, 04:37 PM
It's unclear whether you are calculating the balance yourself (... I put 1000Cr...), or getting the balance string directly from the database (... the type of balance is string...).
You imply that the credit/debit amounts are always positive, so is the final balance just sum(all credit) - sum(all debit)?