Combine formulas

wiesem

New member
Local time
Today, 15:53
Joined
Jun 9, 2016
Messages
6
I have two columns name NRESULT and TRESULT. I want to add one or the other into a new field on a report. The idea is that if the NRESULT is null, then it should use the TRESULT, and the other way around. I created the follow formula: NTResult: IIf(IsNull([NRESULT]),[TRESULT],IIf(IsNull([TRESULT]),[NRESULT],[TRESULT])).
It works well, except if the TRESULT is empty, then it does not use the NRESULT, because of the formula above. It is possible to combined the following two formulas:
IIf(IsNull([NRESULT]),[TRESULT],[NRESULT])
IIf(IsNull([TRESULT]),[NRESULT],TRESULT])
 
you could simply use:

NTResult: IIf(IsNull([NRESULT]),IIf(IsNull([TRESULT]),NULL,[TRESULT]), [NRESULT])
 
Try using Len(NRESULT) > 0

This a bit of a catch-all but quite useful as times

Simon
 
Hi arnelgp,

Using your suggested formula now gives me only the NRESULT if there is both the NRESULT and TRESULT, but I want the TRESULT to report if there is both.

For example if:
1) The NRESULT is 8 and the TRESULT is empty: I want the 8 to show on the reports
2) The NRSULT is 8 and the TRESULT is NEGATIVE: I want the NEGATIVE to show on the reports.
 
Hi Simon, sorry but I am a real beginner, can you maybe give me the whole formula?
 
hello again, just reverse the formula in your expression:

NTResult: IIf(IsNull([TRESULT]),IIf(IsNull([NRESULT]),NULL,[NRESULT]), [TRESULT])
 
Hi, thanks for help, but I used the following formula:

NTResult: IIf(Len([TRESULT] & "")=0,[NRESULT],[TRESULT])
 

Users who are viewing this thread

Back
Top Bottom