Data

sven2

Registered User.
Local time
Today, 20:27
Joined
Apr 28, 2007
Messages
297
Hello,

to retrieve data from a table I use the following code:

strSQL = strSQL & " LEFT(UPPER(Werknemers.Achternaam),1) + LOWER(RIGHT(Werknemers.Achternaam,LEN(Werknemers.Achternaam)-1)) "
strSQL = strSQL & " + ' ' + LOWER(Werknemers.Tussenvoegsel), "
strSQL = strSQL & " LEFT(UPPER(Werknemers.Voornaam),1) + LOWER(RIGHT(Werknemers.Voornaam,LEN(Werknemers.Voornaam)-1)) "

Everything is just working fine if there is data in the fields achternaam, voornaam and tussenvoegsel. The problem is that the fields voornaam and tussenvoegsel can be empty. If that is the case there is no data showed ...

How can I solve this problem?

Thanks in advance,
Sven.
 
That is because Null + 'Something' = Null.

You are looking for Coalesce or Isnull functions to replace the null by an empty string

Make sure to add trim in there as well to prevent double spacing when there is no tussenvoegsel.

Greetings from Amsterdam :)
 

Users who are viewing this thread

Back
Top Bottom