Full Version: number of days overdue
UtterAccess Forums > Microsoft® Access > Access Date + Time
jcampbell
I want to calculate the difference between today's date, and a due date, to give me number of days overdue. So, in my default value for DaysOverdue, I am trying to put in:
DateDiff("d",[=Now()],[DueDate])
But I'm getting an error saying could not find field '=Now()'
Am I missing something???
R. Hicks
Try ...
DateDiff("d",Date(),[DueDate])
RDH
jcampbell
The database engine does not recognize either the field 'DueDate' in a validation expression, or the default value in the table RENTALS'
That could that mean?
R. Hicks
Is the field "DueDate" in the recordset ???
If not where is it ???

RDH
jcampbell
it's in the same table
R. Hicks
Post what you are using and where you are using it ...
And .. what is the result .. an error ???

RDH
jcampbell
i'm not sure what you're asking me to do....
R. Hicks
I need you to post exactly what you are using that is not woking correctly ...
And I need to know where you are using it .. is it in the control source of a txtbox of a form, report or elsewhere ???
DH
jcampbell
actually... it turns out i needed to do a little more than put it as a default value, but i figured out a query that calculates it for me, and then i can put it into the report i need.
Thanks all the same. Much appreciated!
R. Hicks
Putting the calculation in your query can slow the query down ...
Orecommend that it be in the Control Source of a textbox in your form or report .. but it's your application ...
DH
SerranoG
ns that the table named RENTALS does not have a field in it called DueDate.
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.