#Error

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
 
G

Golfinray

Try IIF(datediff("d",[first],[second]) is null, "
",(datediff("d",[first],[second]))
 
J

John Spencer

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
 

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

Similar Threads

Date query 4
Data type mismatch 3
Error -2147352567 (80020009), Access 2007 0
date diff expression in query 5
Before Update 6
Avg expression in a query 4
Pivot Tables with text fields 2
DateDiff on blank fields? 4

Top