I am having an issue with the result of the formula below in crystal reports. Due to the type of join there are instances where the table "CustomerLocation" may be null. To correct for this I constructed the formula below to return a field that is valid if the Location table is null. I have verified that the Customer.CustomerName field does have a value, and simply dragging the field to the report does show this to be the case. Why am I always returning an empty string from this formula?
if {CUSTOMER.ID#} = 2075 or {CUSTOMER.ID#} = 2454 then
(
{tblOrderHeader.BillName}
)
else if {CUSTOMERLOCATION.Customer Name} = "" or IsNull({CUSTOMERLOCATION.Customer Name}) = true then
(
{CUSTOMER.CustomerName}
)
else
(
{CUSTOMERLOCATION.Customer Name}
)
if {CUSTOMERLOCATION.Customer Name} = "" or IsNull({CUSTOMERLOCATION.Customer Name}) then ({CUSTOMER.CustomerName}) else if {CUSTOMER.ID#} in ['2075','2454'] then ({tblOrderHeader.BillName}) else({CUSTOMERLOCATION.Customer Name})
-- the syntax of your formula looks correct. I have found the behavior can change depending on which condition is evaluated first. – Aron