Jump to content


Photo

calculate balance


  • Please log in to reply
2 replies to this topic

#1 takeiteasy

takeiteasy
  • Members
  • PipPipPip
  • Advanced Member
  • 32 posts

Posted 26 April 2006 - 08:58 AM

I have this problem here, i want to generate outstanding balance in my codes.
i have 2 attributes, quotes and amtPaid in mysql table.
my outstanding balance = quotes - amtPaid
so do i need to declare a new attribute in the MySQL table?
do MySQl have Subtraction aggregate functions?

Thanks In Advance!

#2 samshel

samshel
  • Members
  • PipPipPip
  • Advanced Member
  • 837 posts

Posted 26 April 2006 - 09:51 AM

[!--quoteo(post=368767:date=Apr 26 2006, 03:58 AM:name=takeiteasy)--][div class=\'quotetop\']QUOTE(takeiteasy @ Apr 26 2006, 03:58 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
I have this problem here, i want to generate outstanding balance in my codes.
i have 2 attributes, quotes and amtPaid in mysql table.
my outstanding balance = quotes - amtPaid
so do i need to declare a new attribute in the MySQL table?
do MySQl have Subtraction aggregate functions?

Thanks In Advance!
[/quote]

Try this out

"select (quotes-amtPaid) as outstanding_balance from table_name"

hth
Cheers,
SamShel
-----------------------------------------------
--: FUTURE IS LINUX :--
-----------------------------------------------

#3 takeiteasy

takeiteasy
  • Members
  • PipPipPip
  • Advanced Member
  • 32 posts

Posted 26 April 2006 - 09:59 AM

Hey! thanks so much! i managed to solve it!! so happy!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users