This must be my week for wierd issues, or my brain is fried.  Not sure which.

I want to update a column in a table by adding the value from a view to the 
existing
column value.  I.E.
Col X in table 1 = 5
Col Y in table 2 = 3

I want to change the value for column X in table one to be (5 + 3) = 8 as an 
example.

The command I am using...

Update BunkTable set SevenFt = (t1.SevenFt + t2.MO_Qty) +
from BunkTable t1, Totals_View t2 +
where t1.MO_Number = t2.MO_Number 

I get no error message and the returned response is :
Columns have been updated in 1 row(s) in BunkTable

Yet the value for SevenFt in BunkTable never updates.  For testing, there is 
only one row
of data in BunkTable and one row in Totals_view.  They are the same MO_Number.

Actual screen shots...

R>sel mo_number, sevenft from bunktable
 mo_numbe sevenft    
 -------- ---------- 
 18066             5

R>sel mo_number, MO_Qty from Totals_view
 mo_numbe MO_Qty          
 -------- --------------- 
 18066                21.

R>update bunktable set sevenft = (t1.sevenft + t2.Mo_Qty) from bunktable t1, 
totals_view t2 where t1.mo_number = t2.mo_number
 Columns have been updated in 1 row(s) in BunkTable

R>sel mo_number, sevenft from bunktable
 mo_numbe sevenft    
 -------- ---------- 
 18066             0

This value should be 26. 

Any thoughts?

-Bob


--
Thompson Technology Consultants 
LaPorte, IN 46350 
219-363-7441

Reply via email to