SQLTeam.com | Weblogs | Forums

Remove one work with create as a column

Hello, I have a column when it has data such as this:
"CFTSS Treatment Plan Review - 10/01/2020 12:00am"
the date /time would change not the word 'Review' I would like to extract
the world review and assign to an output column.

So what would you like the final data look like

I want the column "CFTSS Treatment Plan Review - 10/01/2020 12:00am" but also
one that has 'Review'.

Not sure I understand what you are asking. Let's see if someone else does

In the data selected we select a column called 'Generic Description'
for those rows that have the string 'CFTSS Treatment Plan Review - 10/01/2020 12:00am' ( the date would change so we are looking for the word 'Review') we wanted to create a column with the word 'Review'

CASE WHEN [Generic Description] Like '% Review %' THEN 'Review' ELSE '' END

thanks, that is nice. How could you get a column name also?

CASE WHEN [Generic Description] Like '% Review %' THEN 'Review' ELSE '' END
AS
column_name_you_want

example
CASE WHEN [Generic Description] Like '% Review %' THEN 'Review' ELSE '' END
AS
WORD