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 sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Not Null Records 1

Status
Not open for further replies.

bld21

Technical User
Mar 1, 2010
49
US
I am using crystal reports 2008 and I want to pull customer name records only if there is a name in the field.

I am trying to write a formula for this to select only records with names and not print the records with no names.

example:

not (IsNull({first_nme} +' ' + {last_nme} + ' '))



Am I close?

Bruce
 
how about:

not(isnull({first_nme}) or TRIM({first_nme})="")
and
not(isnull({last_nme}) or TRIM({last_nme})="")
 
Something is not working. On the report the field says "True".

I am using this in my formula:

{customer.prefix_nme} + ' ' + {customer.first_nme} + ' ' + {customer.middle_nme} + ' ' + {customer.last_nme})

Which gives me accounts with and without names in the field. I want to skip the accounts with no names.
 
If you are trying to select records, it may be better to create an empty formula call {@Null} (create a new formula, name it and save it without typing anything in it) then use the select expert and choose your field, for criteria select "not equal to" and then your {@Null} formula.

If it is just for display of records, here is a formula that should return the full name if the first name and last name are not null:
//{@fullname}
IF (not(isnull({first_nme}) or TRIM({first_nme})="")
and
not(isnull({last_nme}) or TRIM({last_nme})=""))
THEN
({customer.prefix_nme} + ' ' + {customer.first_nme} + ' ' + {customer.middle_nme} + ' ' + {customer.last_nme})
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top