Report
(1)
SecondDate
(1)
FirstDate
(1)
Workdays
(1)
Subreport
(1)
Hasdata
(1)

Calculations with empty fields

Asked By Learning as I go
20-Nov-09 03:17 PM
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
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.
--
Thank you for your time and assistance!

Elizabeth

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

John Spencer replied to Learning as I go
20-Nov-09 03:53 PM
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

Thank you so much. I was obviously looking at it all wrong Friday.

Learning as I go replied to John Spencer
23-Nov-09 10:30 AM
Thank you so much.  I was obviously looking at it all wrong Friday.
--
Thank you for your time and assistance!

Elizabeth
Post Question To EggHeadCafe