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

REPRESENTING NULL FIELDS WITHIN A FORMULA

Status
Not open for further replies.

ERPEEP

Technical User
Oct 6, 2005
1
GB
Hi, hope one of you guys will be able to help me on this one.

I am attempting to add a formula field to a report. I have two fields within the report that I am attempting to use within the formula. {WO.Part_No} and {SO_Items.Part_No}. The purpose of the formula is to return a 'YES' when the {SO_Items.Part_No} contains data when the {WO.Part_No} field contains a 'NULL' value. And to return a 'NO' when both fields contain data.

All I've managed so far is
IF {WO.Part_No}= "" AND {SO_Items.Part_No}= "*" THEN 'YES'
ELSE 'NO'

I have tried this and a number of other formula variants advised by other people, and each has returned either a completely empty formula field or a formula field which only contains a return against those {WO.Part_No} fields that are not Null values. Every formula field I have tried has null values correspondint to the null values within the {WO.Part_No} field.

I am completely lost on this one and fear that if it continues I may well attempt to test the aerodynamics of a laptop (from the roof). Any assistance much appreciated.
 
Null is generally tested using isnull(), but to be safe, do both, as in:

if
(
isnull({wo.part_no})
or
trim({WO.Part_No})= ""
)
and
(
not(isnull({SO_Items.Part_No})
and
trim({WO.Part_No})<> ""
) then
"Yes"
else
"No"

This should get you close, however your requirements are flawed in that you don't address what you want if {SO_Items.Part_No} is null and the other field is not, or if both are null.

-k

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top