December 31st, 2013, 10:07 AM
Case Statement in Update Script
Good morning and Happy New Year,
I am trying to do an update on a table where one of the update set statment needs to based on the "state' of another field.
If the field nc_opp_status already equals 'Approved' then I do NOT want to update the nc_modifydate field, otherwise take the incoming paramenter and update the field nc_modifydate.
I am getting the following error:
An expression of non-boolean type specified in a context where a condition is expected, near 'ELSE'
Here is the statment:
SET NOCOUNT ON;
SET [NC_SP_ID] = @nc_sp_id
,[NC_Opportunity_CRMID] = @nc_opportunity_crm_id
WHEN [NC_Opp_Status} = 'Approved' THEN [NC_ModifyDate]
Any helps is of course always appreciated.
December 31st, 2013, 11:47 AM