Datediff Function

D

Denise

Hello,

I am trying to use the datediff function on my form to
calculate the time it took to complete a file. It reads:
=DateDiff("d",[Date File Recieved],[Date Closed]) the
error says "The value you entered for this field is not
valid"....It still seems to work but every time I flip
through records it gives me the error. The feild type is
a number so I can't figure out why it is still doing
this. Any idea or other ways to calculate the number of
days between 2 dates?

Thank you,

Denise
 
W

Wayne Morgan

The field type is a number? If this is a calculated control, there should be
no field type. Do you mean that you have it formatted as a number? Also, the
data type of the 2 dates should be date/time. Are the 2 dates coming from a
field or something typed into another textbox?

You say you get the error when you start flipping through the records. Do
all the records have valid values for [Date File Received] and [Date
Closed]? If either value is Null, the function will return Null, but if
there is something else in the fields (and if they aren't date/time fields,
there may be) you may get an error.
 
P

Pat

Denise

I have used calculations in a query to calculate the
number of days between two dates. In my table there is a
field which would store the number of days between the two
dates. I include this field in a query and make a simple
math calculation between the two fields that contain the
dates I am using. Like,the two fields dateitemordered,
and dateitemreceived. The stored field would contain a
formula to calculate [dateitemrecd]-[dateitemordered]. If
you need more info, you can email me at (e-mail address removed).
Hope this helps
 

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