Date Calculation

J

John Hansen

I have two Date/Time fields on a spreadsheet, AppReceived and AppProcessed.
I need Access to calculate the number of days from when an application was
received and when it was processed. I've tried DateDiff, but keep getting
errors. Can someone offer a suggestion? Thanks!
 
D

Douglas J. Steele

DateDiff("d", [AppReceived], [AppProcessed]) should give you the number of
days between the two dates, provided both have values.
 
W

Wayne-I-M

Hi

spreadsheet ? are you talking about excell or access

if you're using access form try something like this in a text box - you're
using a query change "=" to "Days:" (without the commas)

=DateDiff("d", [AppReceived], [AppProcessed])

If this doesn't work then you could post more details about the specific
error message and controls (names and formats, etc)
 
J

John Hansen

There have been several. One says "The expression you entered has a function
containing the wrong number of arguments". Another way I tried it tells me
"The database engine does not recognize either the field "AppProcessed" in a
validation expression, or the default value in the table...". I haven't been
able to recreate all the others.
 
J

John Hansen

Thank you for your suggestions. Access still gives the error "The database
engine does not recognize either the field "AppProcessed" in a validation
expression, or the default value in the table...".

Douglas J. Steele said:
DateDiff("d", [AppReceived], [AppProcessed]) should give you the number of
days between the two dates, provided both have values.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


John Hansen said:
I have two Date/Time fields on a spreadsheet, AppReceived and AppProcessed.
I need Access to calculate the number of days from when an application was
received and when it was processed. I've tried DateDiff, but keep getting
errors. Can someone offer a suggestion? Thanks!
 
J

John W. Vinson

Thank you for your suggestions. Access still gives the error "The database
engine does not recognize either the field "AppProcessed" in a validation
expression, or the default value in the table...".

Douglas J. Steele said:
DateDiff("d", [AppReceived], [AppProcessed]) should give you the number of
days between the two dates, provided both have values.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


John Hansen said:
I have two Date/Time fields on a spreadsheet, AppReceived and AppProcessed.
I need Access to calculate the number of days from when an application was
received and when it was processed. I've tried DateDiff, but keep getting
errors. Can someone offer a suggestion? Thanks!

Where are you putting the expression? It should be in a vacant Field cell in
the query design grid, or else preceded by an = sign in the Control Source
property of a Form or Report textbox.

John W. Vinson [MVP]
 
Top