SQL Server: Adding two cell values

cismajor97

Weaksauce
Joined
Mar 23, 2006
Messages
88
Hello,

I'm working on a project and I'm trying to know if you can add the values of two cells in a table and have the result of that equation entered in a third cell in the same table.

Example:

Cell1: 5
Cell2: 7
Cell3: (Cell1)+(Cell2)
 
Hello,

I'm working on a project and I'm trying to know if you can add the values of two cells in a table and have the result of that equation entered in a third cell in the same table.

Example:

Cell1: 5
Cell2: 7
Cell3: (Cell1)+(Cell2)

I assume cell's 1,2, and 3 are on the same record?

Here's my quick view of your DB table:

MyTable (table name)
key (int)
column1 (int) <contains cell 1>
column2 (int) <contains cell 2>
column3 (int) <contains cell 3>​
UPDATE [Catalog_name].[dbo].MyTable
SET
column3 = column1 + column2
WHERE key = <the value pointing to that record>

Got it?
 
Back
Top