>Hi
>
>If I have two fields being changed in an update or replace statement is it valid to rely on a the changed value of the first field in the statement when setting the second or should I always do two passes?
>
>eg.
UPDATE mytable SET ;
> field1 = CalcForwardTime(), ;
> field2 = OtherCalc(field1)
>
>Regards
>Geoff Scott
Nice question.
I'd be inclined to compute their vals before the update, e.g.
lcField1 = CalcForwardTime()
lcField2 = OtherCalc( lcfield1)
Update MyTable set field1 = lcField1, ;
field2 = lcField2
- Whoever said that women are the weaker sex never tried to wrest the bedclothes off one in the middle of the night
- Worry is the interest you pay, in advance, for a loan that you may never need to take out.