I am trying to write a query with a case statement. I am having problems outputting my case statement as multiple variables. Basically I want to take 1 column and out put the first part as outputcolumn1 "FIRST" and the last 4 characters as outputcolumn2 "LAST"
I tried doing some research but I am not finding anything to address my flavor... I know I am overlooking something really dumb.
Select *
Case When a.col_1 is NULL
-- Grab all but last 4 as "FIRST"
Then LEFT(b.col_1, len(b.col_1) -4
-- Grab Last 4 as "LAST"
AND RIGHT(b.col_1, 4)
Else LEFT(a.col_1, len(a.col_1) -4
AND RIGHT(a.col_1, 4)
end as FIRST,LAST
From Table_1 as a
inner join Table_2 as b on a.TableID = b.TableID