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!

If, then, else on Null values

Status
Not open for further replies.

Debnla

Vendor
Mar 5, 2007
16
0
0
US
My syntax :
if {vInvoiceHeaderWithAdj_DH.AdjType} = 501 then {vInvoiceHeaderWithAdj_DH.adjDate} else {vInvoiceHeaderWithAdj_DH.TranDate}

AdjType contains 501, 502 and nulls.
I want the results to show TranDate if AdjType is 502 OR if it contains nulls.

My current results only returns the correct date on the AdjType value that is NOT a null. If AdjType is null, I get no date. This is wrong. It should show TranDate if it is null.

How can I fix this?

Thanks in advance.
 
If isnull({YourField}) then <true logic> else <false logic>

Always put the null test first.

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"What version of URGENT!!! are you using?
 
If isnull({vInvoiceHeaderWithAdj_DH.AdjType}) then {vInvoiceHeaderWithAdj_DH.TranDate} else
if {vInvoiceHeaderWithAdj_DH.AdjType} = 501 then {vInvoiceHeaderWithAdj_DH.adjDate} else
{vInvoiceHeaderWithAdj_DH.TranDate}

It worked like a champ. Thanks so much!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top