I try to select as shown below:

```
CREATE TABLE v_test 
(
    id int,
    name char(4)
);

INSERT INTO v_test
    SELECT 1, NULL
    UNION
    SELECT 2, NULL

SELECT
    id,  
    CASE 
       WHEN name IS NULL
          THEN '   ' 
          ELSE CAST((LEFT(name, 2) + ':' + SUBSTRING(name, 3, 2) + ':00') AS TIME) 
    END AS test,
    name
FROM
    v_test;

SELECT
    id,  
    CASE
       WHEN name IS NULL
          THEN '   ' 
          ELSE '0'
    END AS test,
    name
FROM v_test;

```

The result from those queries looks like this:

[![enter image description here](https://i.stack.imgur.com/RjyLy.png)](https://i.stack.imgur.com/RjyLy.png)

You can see, result case when is not affect in function cast. Can someone explain detail for me.