Calculations with empty fields

L

Learning as I go

I have a report that is calculating total elapsed time between dates. I have
the calculation working fine if all fields are filled in. However, out of
necessity there will always be fields that are not filled in yet (because the
orders have not yet arrived, shipped, etc.). I am (of course) getting the
#error result for all of these cases. I would like for these fields to
remain blank until the orders have arrived, shipped, etc.

I am pretty sure that I need to use .hasdata, but can not quite get it to
work. My expression for the calculated fields is below.

=Workdays([FirstDate],[SecondDate])

I would greatly appreciate any help you can give.
 
J

John Spencer

HasData is used to determine if a report or subreport has data.

For individual fields you need to test if the field is null or not.

=IIF(IsNull([FirstDate]) or IsNull([SecondDate]), Null,
Workdays([FirstDate],[SecondDate]))

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
 
L

Learning as I go

Thank you so much. I was obviously looking at it all wrong Friday.
--
Thank you for your time and assistance!

Elizabeth


John Spencer said:
HasData is used to determine if a report or subreport has data.

For individual fields you need to test if the field is null or not.

=IIF(IsNull([FirstDate]) or IsNull([SecondDate]), Null,
Workdays([FirstDate],[SecondDate]))

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
I have a report that is calculating total elapsed time between dates. I have
the calculation working fine if all fields are filled in. However, out of
necessity there will always be fields that are not filled in yet (because the
orders have not yet arrived, shipped, etc.). I am (of course) getting the
#error result for all of these cases. I would like for these fields to
remain blank until the orders have arrived, shipped, etc.

I am pretty sure that I need to use .hasdata, but can not quite get it to
work. My expression for the calculated fields is below.

=Workdays([FirstDate],[SecondDate])

I would greatly appreciate any help you can give.
.
 

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