I have a column, and the data type is int, but there are some NULL's in there, and as I am reporting off this, I do not want to have NULL appear in the report, I'd prefer 'Unknown', and would like to change this at the database level. The code I am trying is...
CASE ISNULL(TableName.[Days since account logon],'NULL')
WHEN 'NULL' THEN TRY_CONVERT(varchar(10),TableName.[Days since account logon],'Unknown')
--WHEN 'NULL' THEN 'Unknown'
ELSE [Days since account logon]
END [Last Logon]
...I'm just not getting it. Would love some help, I expect this is easy for a lot of people. The error I receive is..
Argument data type varchar is invalid for argument 3 of convert function.
..I understand what it is saying, I just cant work out the workaround, or what the code should be. Thank you for reading.