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!

Problem with a simple If-Then-Else formula 1

Status
Not open for further replies.

suefhmis

Instructor
Jan 24, 2002
25
0
0
US
I've created a simple if-then-else formula (am using CR 8.5) as follows:

if {query.co_owner} = ""
then {query.owner}
else {query.co_owner}

The purpose of this formula is to return the owner's name only if there is no co-owner.

The formula correctly returns the co-owner's name, but will not return the owner's name. When I run my query, I can see both fields. I can put both fields on my report and see the applicable data. The only problem I'm having is with this selective formula.

Anyone know why? Thanks!
 
Maybe what you deem to be empty strings are really null values.

Try this instead:

If IsNull({query.co_owner}) or Trim({query.co_owner}) = ""
Then {query.owner}
Else {query.co_owner}

Naith
 
That worked beautifully, Naith. Thank you so much.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top