IIF euestion once more

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

On my report I have the summary field which is showing #Error when there is
no data matching query criteria (date range). To show blank instead of #Error
I am trying:

=IIf(IsError(Sum([Actual Cost])),Null,Sum([Actual Cost]))

but error does not want to go away. How to modify this IIf statement to fix
it ?

Tony
 
I try to avoid an IIf() function that might return a numeric value or might
return a string. I prefer to be consistent with the datatype of the result
of the calculation. Consider using:
=IIf([HasData],Sum([Actual Cost]),Null)
or
=IIf([HasData],Sum([Actual Cost]),0)



--
Duane Hookom
MS Access MVP
--

Tony said:
I have it fixed:

=IIf([HasData],Sum([Actual Cost]),"")

Tony

Tony said:
On my report I have the summary field which is showing #Error when there
is
no data matching query criteria (date range). To show blank instead of
#Error
I am trying:

=IIf(IsError(Sum([Actual Cost])),Null,Sum([Actual Cost]))

but error does not want to go away. How to modify this IIf statement to
fix
it ?

Tony
 
Hi Duane,

Thank you for your suggestion. I have replaced 0 with Null.

Tony

Duane Hookom said:
I try to avoid an IIf() function that might return a numeric value or might
return a string. I prefer to be consistent with the datatype of the result
of the calculation. Consider using:
=IIf([HasData],Sum([Actual Cost]),Null)
or
=IIf([HasData],Sum([Actual Cost]),0)



--
Duane Hookom
MS Access MVP
--

Tony said:
I have it fixed:

=IIf([HasData],Sum([Actual Cost]),"")

Tony

Tony said:
On my report I have the summary field which is showing #Error when there
is
no data matching query criteria (date range). To show blank instead of
#Error
I am trying:

=IIf(IsError(Sum([Actual Cost])),Null,Sum([Actual Cost]))

but error does not want to go away. How to modify this IIf statement to
fix
it ?

Tony
 
Back
Top