Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Any ideas what is in this 'empty' field?

Status
Not open for further replies.

shera4111

Programmer
Apr 12, 2006
27
CA
Greetings,

Here's a stumper. I have a field that displays as blank on my reports. Now, it's entirely possible that the thing has nothing in it... but I'm trying to filter for it, and I can't get anywhere.

It's not null.
It's not a blank string.
It's not a string of blanks (ie trim(field)="")

So to test it, I wrote a little formula called 'test'. When test has the underlying formula:
"x"+"x" - I get "xx" on screen
"x"+{field}+"x" - I get blank on screen

Anyone have any idea what's up with this field?
Thanks,
 
Hi,
Any string concatenation ( the + stuff) will be blank if any field used in the concatenation is blank.

Try this formula:
Code:
@WhatIsIt
If IsNull({field}) or Trim({field}) = "" Then
"No data in this field for this record"
Else
"This Field has " + {field} + " As its data"

[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
How did you determine?:

It's not null.
It's not a blank string.
It's not a string of blanks (ie trim(field)="")

It behaves precisely like it's null.

And a real test for values would be:

if isnull({table.field}) then
"Null"
else
if len(trim({table.field})) = 0 then
"Blank"
else
{table.field}

I suspect Turk's solution should get you close, the point is to check for null.

-k
 
Guys, thanks for the info - the field did indeed have 'null' in it. Here's the reason I was confused. I was trying to suppress a section based on the following formula:

trim({field})="" or
isnull({field})

That formula would always return false. So my section never suppressed. So, in my logical way, I decided that the field couldn't have null in it, otherwise isnull({field}) would have returned true, making the whole formula true.

Apparently, for whatever reason, the above formula will not work as intended (true if either is true), if the nullity clause is not first in the list. When I rearranged the formula so it looked like this:

isnull({field}) or
trim({field})=""

It worked just fine. Bah! Will remember this for next time, but thought it might help someone else.

Thanks to all who helped.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top