Here is the query:
ReportName:Iif([Nickname]=””,[FirstName],[Nickname])
When that runs, most records come back correctly, but some records with no nickname come back with a blank ReportName field, and there is a name in the FirstName. But I should be seeing the FirstName value in ReportName.
I thought perhaps there was some “invisible” text in Nickname, so I tried the following and got similar results:
ReportName:Iif(Len([Nickname])=0,[FirstName],[Nickname]) (means Nickname has a length, since it seems to have returned the Nickname)
ReportName:Iif(IsNull([Nickname]),[FirstName],[Nickname]) (means Nickname is NOT Null since it seems to have returned the Nickname)
It appears that there is an invisible value in the Nickname field, but If I typed anything into the nickname field, the ReportName came back OK. If I then delete the value in the Nickname field, once again, the ReportName comes back blank.
This finally fixed it for me:
ReportName:Iif([Nickname]””,[Nickname],FirstName])
If there is no value in Nickname, the FirstName shows up in ReportName.
So, what could be in the “empty” nickname fields to cause this? Is there some kind of Mass Update I could do to “fix” the field.
Right now my revised code is working, but I am curious about the tech issue in the background. The really strange thing is that most of the records do work correctly showng the FirstName, but about 10% with the same condition (Has FirstName, no Nickname) show nothing.
Perhaps this means that the database needs to be repaired/reindexed?