I have a relatively simple query except 1 field is a text field which users can either choose from a pull down or type the entry. The problem occurs when the users abbreviate what are supposed to be standardized answers because if they don't they will not fit into the field. For example: 'Yearly RR Required' could be entered 'YRR Required' or 'YYR Req'. Also..... this field could contain more than one entry separated by a comma. For Example: 'Yearly RR Required', 'Continue Current MH Services'. My question is how can I write a CASE statement that will only pull 'Yearly RR Required' regardless of the other text that is in the field?
I wrote this CASE Statement....
CASE WHEN clmastbcassr.ASSESSTYPE = 'PAS' and clmastbcassr.RECOMMEND = 'Yearly RR Required' then DATEADD(DD,365,clmastbcassr.STAFFDATE) end AS [YEARLY DUE DATE]
This will return only data where the clmastbcassr.RECOMMEND field = 'Yearly RR Required' but if anything else is in that field it will come back NULL. I guess I could use LIKE but that still seems too vague. Help is appreciated!
BDB
I wrote this CASE Statement....
CASE WHEN clmastbcassr.ASSESSTYPE = 'PAS' and clmastbcassr.RECOMMEND = 'Yearly RR Required' then DATEADD(DD,365,clmastbcassr.STAFFDATE) end AS [YEARLY DUE DATE]
This will return only data where the clmastbcassr.RECOMMEND field = 'Yearly RR Required' but if anything else is in that field it will come back NULL. I guess I could use LIKE but that still seems too vague. Help is appreciated!
BDB