Hi Mike,
As always, terse and to the point :-)
Too bad, would have been nice.
Any way around this?
>You can't modify data in a table from within a UDF.
>
>-Mike
>
>>
>>
>>
>>IF @Discrepancy <= 0 AND @IsStatus = 0
>> BEGIN
>> UPDATE CBInvoice
>> SET IsStatus = 1
>> WHERE ...
>>END
>>
>>
>>Discrepancy (calculated as subtract a -(b+c), where a,b and c are fields in CBInvoice) and IsStatus are both fields in CBInvoice.
>>
>>
>>TIA
Peter Pirker
Whosoever shall not fall by the sword or by famine, shall fall by pestilence, so why bother shaving?
(Woody Allen)