#Error

  • Thread starter Thread starter Radhika
  • Start date Start date
R

Radhika

I am trying to caculate the difference in Dates between VP Insertion Date and
VP Removal Date. There are some VP Removal Dates that are null. When I
calculate the difference, I get the message #Error in a new feild called
TimeDiff.
How do I prevent this from happening?
The expression I used is as follows:
Time: DateDiff("d",[VP Insertion date],[VPRemovalDateB])

Thank you!
Radhika
 
Try the following.

IIF([VPRemovalDateB] is Null, Null,
DateDiff("d",[VP Insertion date],[VPRemovalDateB]))

If you want some other result then replace the Null with the desired outcome.

John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
Try IIF(datediff("d",[first],[second]) is null, "
",(datediff("d",[first],[second]))

Radhika said:
I am trying to caculate the difference in Dates between VP Insertion Date and
VP Removal Date. There are some VP Removal Dates that are null. When I
calculate the difference, I get the message #Error in a new feild called
TimeDiff.
How do I prevent this from happening?
The expression I used is as follows:
Time: DateDiff("d",[VP Insertion date],[VPRemovalDateB])

Thank you!
Radhika
 
Back
Top