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

Null Formula 2

Status
Not open for further replies.

dunkyn

Technical User
Apr 30, 2001
194
US
Newbie question...what is the correct way to search for a null (blank) ? I receive errors on the first line ...looking for the word then...

If Isnull {POSITION_DG.TRM_TO_MAT_RTE} then "0 - 1 Year"
Else If
If {POSITION_DG.TRM_TO_MAT_RTE}>15 Then "15+ Years"
Else If
{POSITION_DG.TRM_TO_MAT_RTE}>10 Then "10 - 15 Years"
Else If
{POSITION_DG.TRM_TO_MAT_RTE}>5 Then "5 - 10 Years"
Else If
{POSITION_DG.TRM_TO_MAT_RTE}>3 Then "3 - 5 Years"
Else If
{POSITION_DG.TRM_TO_MAT_RTE}>1 Then "1 - 3 Years"
Else If
{POSITION_DG.TRM_TO_MAT_RTE}>0 Then "0 - 1 Year"
else
" "

TIA
 
You forgot the parens for the isnull and had an error in the IFs, try:

If Isnull ({POSITION_DG.TRM_TO_MAT_RTE}) then "0 - 1 Year"
Else If
{POSITION_DG.TRM_TO_MAT_RTE}>15 Then "15+ Years"
Else If
{POSITION_DG.TRM_TO_MAT_RTE}>10 Then "10 - 15 Years"
Else If
{POSITION_DG.TRM_TO_MAT_RTE}>5 Then "5 - 10 Years"
Else If
{POSITION_DG.TRM_TO_MAT_RTE}>3 Then "3 - 5 Years"
Else If
{POSITION_DG.TRM_TO_MAT_RTE}>1 Then "1 - 3 Years"
Else If
{POSITION_DG.TRM_TO_MAT_RTE}>0 Then "0 - 1 Year"
else
" "

-k
 
You should also add this after your null statement because a blank is not necessarily null:

If isnull({POSITION_DG.TRM_TO_MAT_RTE}) or
{POSITION_DG.TRM_TO_MAT_RTE} = ""
then...
 
Good point, Stormtropper, even add to that:

You should also add this after your null statement because a blank is not necessarily null:

If isnull({POSITION_DG.TRM_TO_MAT_RTE}) or
trim({POSITION_DG.TRM_TO_MAT_RTE}) = ""
then...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top