doug.davidson (4/8/2013)
I have never explored a CTE before. Good new research and learning for me.I will use the sub select as the new work around until I finish my learning on the CTE approach.
Thanks for you time everyone.
just noticed the forum was SQL2000, so here's the same thing as a sub select, if it wasn't obvious how to convert the first example:
update rmc
set rmc.sla_target_date = dbo.fn_GetTargetTimeInServiceHours(rmc.project_id, rmc.folder_id, rmc.sla_start_date, (rmc.hold_time + @target_time))
from #request_meet_criteria rmc
INNER JOIN (
SELECT rmc.*,
NewTargetDate = dbo.fn_GetTargetTimeInServiceHours(rmc.project_id, rmc.folder_id, rmc.sla_start_date, (rmc.hold_time + @target_time))
FROM #request_meet_criteria rmc
rmc.smx_active_flag = 0
) myIntermediateResults
ON rmc.project_id = myIntermediateResults.project_id
AND rmc.request_id = myIntermediateResults.request_id
Lowell