Reputation: 21
Currently trying to write a query, and wanting to complete a field with spaces if it is NULL.
For example:
SELECT * FROM (X)
WHERE YEAR = @TaxYear
LEN(SortCode) > 6 and ISNUMERIC(SUBSTRING(SortCode,1,6)) = 1
Upvotes: 0
Views: 43
Reputation: 22001
To replace a null value with six spaces use COALESCE(columnName, ' ')
Upvotes: 1