Skip to content
Advertisement

Convert Null to text on numeric field

I have a query that LEFT joins 4 different tables. There will always be a match in one of these tables but we don’t know which one. When the query is executed there are some fields producing NULL values. These are float fields but I was wondering if there is a way to change the Null to some kind of indicator such as “No Coverage”?

I have attempted something simple such as:

However when I run this I get the following error message:

I’m sure its something simple but I have tried CONVERT and CAST but with no joy.

Thanks in advance

Advertisement

Answer

First, use COALESCE(). It is the standard function. Then convert the number to a string:

You can do the same thing with ISNULL().

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement