I'm trying to manipulate the return of a string where I need to always get the where block from the select problem so my method always returns different strings.
For example:
SELECT.....
FROM.....
WHERE
(
(
UPPER(INDICADO.IND_DESCRI) IS NULL AND
UPPER(CASE WHEN IND_PERIOD = 0 THEN 'LABELDIARIA' WHEN IND_PERIOD = 1 THEN 'LABELSEMANAL' WHEN IND_PERIOD = 2 THEN 'LABELQUINZENAL' WHEN IND_PERIOD = 3 THEN 'LABELMENSAL' WHEN IND_PERIOD = 4 THEN 'LABELBIMESTRAL' WHEN IND_PERIOD = 5 THEN 'LABELTRIMESTRAL' WHEN IND_PERIOD = 6 THEN 'LABELSEMESTRAL' WHEN IND_PERIOD = 7 THEN 'LABELANUAL' END) = @PERIODICIDADE1
)
)
Order by ......
You would need to get in a variable only with the where.