Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Question - Summing

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2007-01-23 : 10:10:53
rabih kahaleh writes "hello,

i need our help for this problem if we have an easier solution or programmation solution:

the problem is :i have table named "Table 1" contains 3 fields
( AmountNumber - AmountID - AmountValue) like below

Amount Number------AmountID-------AmountValue
----12----------------25-------------14------
----54----------------44-------------89------

i need to make an extra colum that sum all the three columns
and the result will be like:

Amount Number AmountID AmountValue TOTAL
12 25 14 51 (12+25+14)
54 44 89 187 (54+44+89)


Amount Number------AmountID-------AmountValue-----TOTAL
----12----------------25-------------14------------51 (12+25+14)
----54----------------44-------------89-----------187 (54+44+89)

Thanks for our support

Best Regards
Rabih kahaleh"

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-01-23 : 10:13:26
[code]Alter Table Table1
Add [Total] as ([Amount Number] + AmountID + AmountValue)[/code]

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page
   

- Advertisement -