IIF euestion once more

T

Tony

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
 
D

Duane Hookom

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
 
T

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top