calculating age in days

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello all. I have read all the posts I could find dealing with calculating
age based on a start date. I can't find anything dealing with calculating
age in days. I have a field 'Invoice Date' on a form with format mm/dd/yyyy.
I have an unbound text box for the pupose of showing the age of the invoice.
I need it to report that the invoice is "xx" days old based on the date
entered in the 'Invoice Date' field. I do not know anything about coding.
Thank you
 
I think you are looking for

datediff("d",[InvoiceDate],now())

if the Invoice date field is of type: date/time then you can
set the data property of the "unbound text box"
open the form in design mode, select the 'unbound text box', select the data
tab set the data property to:

data = datediff("d",[InvoiceDate],now())

if Invoice date field is of type text then you will have to convert it to a
date.

Ed Warren
 
Put the following as the control source for the unbound text box:

=DateDiff("d", Me![Invoice Date], Date())
 
When I do that I get the error #Name? in the unbound box.

Douglas J Steele said:
Put the following as the control source for the unbound text box:

=DateDiff("d", Me![Invoice Date], Date())

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Greg Snidow said:
Hello all. I have read all the posts I could find dealing with calculating
age based on a start date. I can't find anything dealing with calculating
age in days. I have a field 'Invoice Date' on a form with format mm/dd/yyyy.
I have an unbound text box for the pupose of showing the age of the invoice.
I need it to report that the invoice is "xx" days old based on the date
entered in the 'Invoice Date' field. I do not know anything about coding.
Thank you
 
That's what I get for posting responses without testing first! You don't
need the Me!

Sorry about that.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Greg Snidow said:
When I do that I get the error #Name? in the unbound box.

Douglas J Steele said:
Put the following as the control source for the unbound text box:

=DateDiff("d", Me![Invoice Date], Date())

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Greg Snidow said:
Hello all. I have read all the posts I could find dealing with calculating
age based on a start date. I can't find anything dealing with calculating
age in days. I have a field 'Invoice Date' on a form with format mm/dd/yyyy.
I have an unbound text box for the pupose of showing the age of the invoice.
I need it to report that the invoice is "xx" days old based on the date
entered in the 'Invoice Date' field. I do not know anything about coding.
Thank you
 
That did it! Thank you so much

Douglas J Steele said:
That's what I get for posting responses without testing first! You don't
need the Me!

Sorry about that.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Greg Snidow said:
When I do that I get the error #Name? in the unbound box.

Douglas J Steele said:
Put the following as the control source for the unbound text box:

=DateDiff("d", Me![Invoice Date], Date())

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Hello all. I have read all the posts I could find dealing with
calculating
age based on a start date. I can't find anything dealing with calculating
age in days. I have a field 'Invoice Date' on a form with format
mm/dd/yyyy.
I have an unbound text box for the pupose of showing the age of the
invoice.
I need it to report that the invoice is "xx" days old based on the date
entered in the 'Invoice Date' field. I do not know anything about coding.
Thank you
 
Back
Top