Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm using a field expression to generate a combination of first and last name seperated by a comma:
= [Last Name] & ', ' & [First Name]
Strange thing is that, depending on the machine I open the document, sometimes it generates an empty value ( " , ").
When selecting the empty value, it is all records are shown.
If I leave out the fixed text ( = [Last Name] & [First Name] ) the empty value is gone.
Then if I open the same document on a other PC, this empty value is also gone.
What is causing this effect?
Is it a usersetting?
Is it a bug?
anybody an idea?
Thanks
I'm going to guess that some of the machine you are using, are 32 bit machines, and other machines are 64 bit machines. What could be happening is - those two environments treat NULL values differently.
The expression "First Name" & "Last Name" will likely produce an empty string or a NULL result for those data elements that are not associated with any valid names.
The expression "First Name" & ', ' & "Last Name" could produce NULL (most likely, on 64 bit machines) or a non-NULL value ", " (most likely, on a 32-bit machine) because 32 bit environments are more "forgiving" to your NULLs.
This is, of course, just a speculation, based on a similar behavior that I've seen before.
cheers,
Oleg Troyansky
Hey Oleg,
Thank you very much for your answer.
You are exactly right with the 64 and 32 bit machines.
But how can this be avoided?
Hans
You may use the following expression:
=If(Len(Trim([Last Name]))>0 or Len(Trim([First Name]))>0, [Last Name] & ', ' & [First Name], Null())
Thank you for this expression.
But these are all solutions AFTER the damage is done.
There are no NULL values in [Last Name] or [First Name]
The line with NULL values is only been generated on a 32 bit machine, when a fixed string is concatinated into the string.
Apparently, this NULL line is also linked (in one way or another) to ALL the possible values generated to the expression. This can be tested by selecting this NULL line, which causes to select all the data.
Probably, in some documents, this line comes in very handy.
So in my opinion, there should be a setting that you can change in order to avoid the generation of this line.
And maybe there is?
Greetings
Hans
Have you considered creating the FullName field in the script? May avoid this alltogether and will most likely be more efficient.
Hope this helps,
Jason