Hi Guys,
Once again I'm struggling with syntax issues and would appreciate some assistance. What is the correct syntax for the SELECT CASE WHEN Statement in this situation
SELECT CASE LEN(@Prefix)
WHEN 1
SET @NewKey = @Prefix + FORMAT(@CurrentValue,'000')
WHEN 2
SET @NewKey = @Prefix + FORMAT(@CurrentValue,'00')
WHEN 3
SET @NewKey = @Prefix + FORMAT(@CurrentValue,'00')
WHEN 4
SET @NewKey = @Prefix
END
I am attempting to evaluate the length of @Prefix and apply the correct format based on that length. The editor simply says incorrect syntax. Any help you can provide is appreciated.