Results 1 to 4 of 4
  1. #1
    Star Lounger
    Join Date
    Feb 2003
    Posts
    60
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to Display Age of Date in Query? (Access 97)

    I am trying to display the age of a date in a query, but I'm not sure how to do it.

    The entry date is input into a table named DATAtbl. If the date is 02/20/03, and I run the query (DATAqry) on 02/25/03, the age returned should be 5.

    Any help provided would be appreciated.

    Thanks,

    Scott

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: How to Display Age of Date in Query? (Access 97)

    Say that your date field is named EntryDate. You can add a column to your query DATAqry:<pre>Ageate()-[EntryDate]</pre>

    The Date() function returns the current date (that is, the date on which the query is run). Since Access stores dates a a number of days (since December 31, 1899), you can simply find the age by subracting the date field from the current date.

  3. #3
    Star Lounger
    Join Date
    Feb 2003
    Posts
    60
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How to Display Age of Date in Query? (Access 97)

    Thanks Hans. It worked great.

    Another question: is there an easy way to return the age, but only based on the number of business days that have passed, i.e. excluded weekends & holidays?

    Thanks again!

    Scott

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: How to Display Age of Date in Query? (Access 97)

    In <post#=159312>post 159312</post#>, you will find several links to solutions.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •