A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

calculating age in days



 
 
Thread Tools Display Modes
  #1  
Old November 17th, 2005, 02:49 PM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default calculating age in days

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
  #2  
Old November 17th, 2005, 03:01 PM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default calculating age in days

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

"Greg Snidow" wrote in message
news
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


  #3  
Old November 17th, 2005, 03:05 PM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default calculating age in days

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

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

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Greg Snidow" wrote in message
news
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



  #4  
Old November 17th, 2005, 03:51 PM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default calculating age in days

When I do that I get the error #Name? in the unbound box.

"Douglas J Steele" wrote:

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

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

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Greg Snidow" wrote in message
news
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




  #5  
Old November 17th, 2005, 04:33 PM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default calculating age in days

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
http://I.Am/DougSteele
(no e-mails, please!)


"Greg Snidow" wrote in message
...
When I do that I get the error #Name? in the unbound box.

"Douglas J Steele" wrote:

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

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

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Greg Snidow" wrote in message
news
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






  #6  
Old November 17th, 2005, 05:47 PM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default calculating age in days

That did it! Thank you so much

"Douglas J Steele" wrote:

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
http://I.Am/DougSteele
(no e-mails, please!)


"Greg Snidow" wrote in message
...
When I do that I get the error #Name? in the unbound box.

"Douglas J Steele" wrote:

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

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

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Greg Snidow" wrote in message
news 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






 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
need help with formula Bryan J Bloom General Discussion 11 October 31st, 2005 10:52 PM
Calculating number of hours between two days NMM Worksheet Functions 1 October 21st, 2005 11:36 AM
Calculating Days of the Week snakeoids Worksheet Functions 4 August 28th, 2004 07:50 AM
calculating (correctly) the weeks and days between dates neon Worksheet Functions 4 June 28th, 2004 03:07 PM
Calculating days of week HBYardSale Setting up and Configuration 2 April 20th, 2004 08:09 PM


All times are GMT +1. The time now is 02:53 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.