0

I'm trying to import data from a table into my SQL Report Builder report.

In this particular column, the data will either be someone's name or "NULL".

I want to set my field to change NULL to "Other", but leave it how it is if it contains a name.

I know I must be close with what I have below, but I can't figure out how to get it to not alter the value if it's NOT NULL:

CASE WHEN ([Reviewed_By] IS NULL) THEN 'Other' ELSE '' END AS [Reviewed_By]

Obviously, with how it's written here, it will convert any name to a blank but I can't figure out the correct logic to get it to "skip" the line-item if it's a valid name.

Any help is appreciated!

Let me know if you need any other information.

Thanks in advance, Cameron

Cameron
  • 17
  • 3

2 Answers2

0

To answer your question for the SQL side.

CASE WHEN [Reviewed_By] IS NULL THEN 'Other' ELSE [Reviewed_By] END AS [Reviewed_By]

Report builder has functionality to do this as well with expressions. You can read more here 32716829/if-value-null-then-else-value-ssrs-expression-issues.

0

you could just do ...

SELECT 
    ISNULL([Reviewed_By], 'Other') AS [Reviewed_By]
    FROM myTable
Alan Schofield
  • 19,839
  • 3
  • 22
  • 35