I am returning the value of a cost centre. However, for reporting purposes, the value needs to be converted to '9999' if the date of the record is pre-2012.
Here's the relevant bit of code:
'P9-'+CAST(RIGHT('0000'+CASE WHEN NL.DET_COSTCENTRE IS NULL THEN '0' ELSE NL.DET_COSTCENTRE END,4) as VARCHAR) as CC_Co,RIGHT('0000'+NL.DET_COSTCENTRE,4) as Cost_Centre,
So I need something incorporated into this bit of code that checks the record date and if it's pre-2012 it simply returns 9999.
Any advice greatly appreciated.