Hi
I am having a problem with a formula which is in a formula field on my report. The formula does what I need it to if I change the report options to "Convert Database NULL Values to Default" and evaluate the fields with <> "". However for other reasons I need to be able to evaluate Null values as Nulls, so I have replaced the <> "" with not isnull.
I have read somewhere that I need to evaluate the Null values first before the rest of the query, however I am really struggling to rearrange the formula to do this.
If anybody has any ideas, your help would be really appreciated.
Currently the formala is as follows
if {Contact.contact_organisation} = {@Comp \ Addr 1} then
(
if {Contact.contact_sub_building} = {@Address 2} then
(
if not (isnull ({Contact.contact_Building})) then
(
if NumericText (left ({Contact.contact_Building},1)) and Length ({Contact.contact_Building}) < 9 then
{Contact.contact_Building} & " " & {Contact.contact_street}
else
{Contact.contact_Building}
)
else
(
if {Contact.contact_building_number} <> "0" and not (isnull ({Contact.contact_street})) then
{Contact.contact_building_number} & " " & {Contact.contact_street}
else
(
if {Contact.contact_building_number} = "0" and not (isnull ({Contact.contact_street})) then
{Contact.contact_street}
else
(
if not (isnull ({Contact.contact_dependent_locality})) then
{Contact.contact_dependent_locality}
else
{Contact.contact_locality}
)
)
)
)
else
(
if {Contact.contact_Building} = {@Address 2} then
(
if {Contact.contact_building_number} <> "0" and not (isnull ({Contact.contact_street})) then
{Contact.contact_building_number} & " " & {Contact.contact_street}
else
(
if {Contact.contact_building_number} = "0" and not (isnull ({Contact.contact_street})) then
{Contact.contact_street}
else
(
if not (isnull ({Contact.contact_dependent_locality})) then
{Contact.contact_dependent_locality}
else
{Contact.contact_locality}
)
)
)
else
(
if {Contact.contact_building_number} & " " & {Contact.contact_street} = {@Address 2} or {Contact.contact_street} = {@Address 2} then
(
if not (isnull ({Contact.contact_dependent_locality})) then
{Contact.contact_dependent_locality}
else
{Contact.contact_locality}
)
else
(
if {Contact.contact_building_number} & " " & {Contact.contact_street} = {@Address 2} then
(
if not (isnull ({Contact.contact_dependent_locality})) then
{Contact.contact_dependent_locality}
else
{Contact.contact_locality}
)
else
(
if {Contact.contact_dependent_locality} = {@Address 2} then
{Contact.contact_locality}
)
)
)
)
)
I am having a problem with a formula which is in a formula field on my report. The formula does what I need it to if I change the report options to "Convert Database NULL Values to Default" and evaluate the fields with <> "". However for other reasons I need to be able to evaluate Null values as Nulls, so I have replaced the <> "" with not isnull.
I have read somewhere that I need to evaluate the Null values first before the rest of the query, however I am really struggling to rearrange the formula to do this.
If anybody has any ideas, your help would be really appreciated.
Currently the formala is as follows
if {Contact.contact_organisation} = {@Comp \ Addr 1} then
(
if {Contact.contact_sub_building} = {@Address 2} then
(
if not (isnull ({Contact.contact_Building})) then
(
if NumericText (left ({Contact.contact_Building},1)) and Length ({Contact.contact_Building}) < 9 then
{Contact.contact_Building} & " " & {Contact.contact_street}
else
{Contact.contact_Building}
)
else
(
if {Contact.contact_building_number} <> "0" and not (isnull ({Contact.contact_street})) then
{Contact.contact_building_number} & " " & {Contact.contact_street}
else
(
if {Contact.contact_building_number} = "0" and not (isnull ({Contact.contact_street})) then
{Contact.contact_street}
else
(
if not (isnull ({Contact.contact_dependent_locality})) then
{Contact.contact_dependent_locality}
else
{Contact.contact_locality}
)
)
)
)
else
(
if {Contact.contact_Building} = {@Address 2} then
(
if {Contact.contact_building_number} <> "0" and not (isnull ({Contact.contact_street})) then
{Contact.contact_building_number} & " " & {Contact.contact_street}
else
(
if {Contact.contact_building_number} = "0" and not (isnull ({Contact.contact_street})) then
{Contact.contact_street}
else
(
if not (isnull ({Contact.contact_dependent_locality})) then
{Contact.contact_dependent_locality}
else
{Contact.contact_locality}
)
)
)
else
(
if {Contact.contact_building_number} & " " & {Contact.contact_street} = {@Address 2} or {Contact.contact_street} = {@Address 2} then
(
if not (isnull ({Contact.contact_dependent_locality})) then
{Contact.contact_dependent_locality}
else
{Contact.contact_locality}
)
else
(
if {Contact.contact_building_number} & " " & {Contact.contact_street} = {@Address 2} then
(
if not (isnull ({Contact.contact_dependent_locality})) then
{Contact.contact_dependent_locality}
else
{Contact.contact_locality}
)
else
(
if {Contact.contact_dependent_locality} = {@Address 2} then
{Contact.contact_locality}
)
)
)
)
)