Replace text

Sam Runyon
Sam Runyon used Ask the Experts™
on
I need to replace some alarms with just the word Alarm or OK I need a wildcard in front of Alm because the only thing that is constant is the last 3 letters in the alarm.

Here is what I am trying.

CASE WHEN CHTKSTS.value = '%Alm' THEN 'Alarm' ELSE 'OK' END as [Chemical Tank Communication Status]
 
ay help?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Software Engineer
Top Expert 2011
Commented:
You need to use the Like operator

CASE WHEN CHTKSTS.value LIKE '%alm' THEN 'Alarm' ELSE 'OK' END as [Chemical Tank Communication Status]

Open in new window

Author

Commented:
Thanks Paul

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial