Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Store (in automatic) a calculated result field of a table

Status
Not open for further replies.

accessuserit

Programmer
Nov 10, 2001
29
IT
i need to store (in auto-mode) a calculated result in another field, for manipulate and save the data.
Help me please!

Paolo Chiesa
 
Suppose calcY is the computed column and valueZ is the column which gets the static saved value as of some moment.

Code:
UPDATE ourTable SET valueZ = calcY

will put the current value as data in valueZ for every row in ourTable. Any changed values will replace old values.

Code:
UPDATE ourTable SET valueZ = calcY
  WHERE valueZ IS NULL

will put current values in valueZ but will not replace old values.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top