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

Heh, Null not liking me 1

Status
Not open for further replies.

Cort

MIS
Joined
Apr 16, 2002
Messages
154
Location
US
Well, so much for my happy name formula. It seems if one of the values is null I get into trouble with the len section. Can you kind souls take a look at my formula nd let me know how to correct it:

in CR 8.5

---

Local StringVar FIRSTNAME;
FIRSTNAME := if isnull({CURR.FIRST_NAME}) then "Null" else
Uppercase(left({CURR.FIRST_NAME},1)) &
Lowercase(right({CURR.FIRST_NAME},Len({CURR.FIRST_NAME})-1)) ;

Local StringVar LASTNAME;
LASTNAME :=if isnull({CURR.LAST_NAME}) then "Null" else Uppercase(left({CURR.LAST_NAME},1)) &
Lowercase(right({CURR.LAST_NAME},Len({CURR.LAST_NAME})-1)) ;

Local StringVar NAME;
NAME := LASTNAME & ", " & FIRSTNAME ;

If isnull({CURR.LAST_NAME}) then {CURR.CL_COMP_NAME} else NAME


---
 
I have a problem with the IsNull function also. I think it is because under File/Report Options/Convert NULL Field Value to Default is checked. Try using "" instead of IsNull.

FIRSTNAME := if {CURR.FIRST_NAME} like "" then "Null"

Good Luck!

Hillary
 
That was exactly it. I was just going to post that I had finally figured it out. Can't use IsNull if there aren't any null values can we :)

Thank you for the post, however, that is the exact solution.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top