Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Date of Birth

Discussion in 'Information Technology' started by Paul S, Nov 18, 2005.

Tags:
  1. Paul S

    Paul S
    Expand Collapse
    Guest

    I would like the formula for determining a person's age. For example: One of
    my fields says: "Date of Birth" and the other field "Age." What is the
    formula I should use to determine that person's age in a query? Any
    assistance would be greatly appreciated. Thank you!
     
  2. Loading...

    Similar Threads Forum Date
    Gurus Guru Nanak Sahib: Real Date of Birth History of Sikhism Jul 3, 2011
    Sikh News BREAKING: Young Sikh Shot Dead In Jalalabad, Afghanistan . - Sikh24 News & Updates Breaking News Oct 2, 2016
    Sikh News Sikh Candidate In Hamilton Disgusted By Racist Vandalism - Newstalk ZB Breaking News Aug 22, 2016
    Sikh News Amit Jani: Trump Leverages Fear In Americans, Wrong Candidate For Our Nation's Future Breaking News Feb 18, 2016
    update Blogs Oct 16, 2015

  3. Allen Browne

    Allen Browne
    Expand Collapse
    Guest

    You can grab this function to calculate the person's age:
    http://allenbrowne.com/func-08.html

    Paul, I trust you understand that you do not put an Age field in your table?
    You use a query to generate the person's age, and that way you don't have to
    update your table every day. If that's a new idea, see:
    Calculated fields
    at:
    http://allenbrowne.com/casu-14.html

    --
    Allen Browne - Microsoft MVP. Perth, Western Australia.
    Tips for Access users - http://allenbrowne.com/tips.html
    Reply to group, rather than allenbrowne at mvps dot org.

    "Paul S" <PaulS@discussions.microsoft.com> wrote in message
    news:B2AAFE2F-D3A1-47CE-982E-E946D9260F8D@microsoft.com...
    >I would like the formula for determining a person's age. For example: One
    >of
    > my fields says: "Date of Birth" and the other field "Age." What is the
    > formula I should use to determine that person's age in a query? Any
    > assistance would be greatly appreciated. Thank you!
     
  4. Paul S

    Paul S
    Expand Collapse
    Guest

    Yes Allen I know that I should not put an Age field in my table but in the
    query. However I am confused about the formula that you referred to in your
    article. Can you simply give me the formula. I am new at ACCESS. Thanks for
    your help.

    "Allen Browne" wrote:

    > You can grab this function to calculate the person's age:
    > http://allenbrowne.com/func-08.html
    >
    > Paul, I trust you understand that you do not put an Age field in your table?
    > You use a query to generate the person's age, and that way you don't have to
    > update your table every day. If that's a new idea, see:
    > Calculated fields
    > at:
    > http://allenbrowne.com/casu-14.html
    >
    > --
    > Allen Browne - Microsoft MVP. Perth, Western Australia.
    > Tips for Access users - http://allenbrowne.com/tips.html
    > Reply to group, rather than allenbrowne at mvps dot org.
    >
    > "Paul S" <PaulS@discussions.microsoft.com> wrote in message
    > news:B2AAFE2F-D3A1-47CE-982E-E946D9260F8D@microsoft.com...
    > >I would like the formula for determining a person's age. For example: One
    > >of
    > > my fields says: "Date of Birth" and the other field "Age." What is the
    > > formula I should use to determine that person's age in a query? Any
    > > assistance would be greatly appreciated. Thank you!

    >
    >
    >
     
  5. Van T. Dinh

    Van T. Dinh
    Expand Collapse
    Guest

    If you want to use Allen's function, you need to copy it to a standard
    module and the use the function in your Query, e.g. a calculated Field like:

    AgeAsAtToday: Age([DOB])

    In you want a simple expression, try:

    http://www.mvps.org/access/datetime/date0001.htm

    --
    HTH
    Van T. Dinh
    MVP (Access)



    "Paul S" <PaulS@discussions.microsoft.com> wrote in message
    news:053F76B1-33D8-4F52-AFEF-5A9AF620125C@microsoft.com...
    > Yes Allen I know that I should not put an Age field in my table but in the
    > query. However I am confused about the formula that you referred to in
    > your
    > article. Can you simply give me the formula. I am new at ACCESS. Thanks
    > for
    > your help.
    >
    > "Allen Browne" wrote:
    >
    >> You can grab this function to calculate the person's age:
    >> http://allenbrowne.com/func-08.html
    >>
    >> Paul, I trust you understand that you do not put an Age field in your
    >> table?
    >> You use a query to generate the person's age, and that way you don't have
    >> to
    >> update your table every day. If that's a new idea, see:
    >> Calculated fields
    >> at:
    >> http://allenbrowne.com/casu-14.html
    >>
    >> --
    >> Allen Browne - Microsoft MVP. Perth, Western Australia.
    >> Tips for Access users - http://allenbrowne.com/tips.html
    >> Reply to group, rather than allenbrowne at mvps dot org.
    >>
    >> "Paul S" <PaulS@discussions.microsoft.com> wrote in message
    >> news:B2AAFE2F-D3A1-47CE-982E-E946D9260F8D@microsoft.com...
    >> >I would like the formula for determining a person's age. For example:
    >> >One
    >> >of
    >> > my fields says: "Date of Birth" and the other field "Age." What is
    >> > the
    >> > formula I should use to determine that person's age in a query? Any
    >> > assistance would be greatly appreciated. Thank you!

    >>
    >>
    >>
     
  6. John Vinson

    John Vinson
    Expand Collapse
    Guest

    On Thu, 17 Nov 2005 04:22:05 -0800, Paul S
    <PaulS@discussions.microsoft.com> wrote:

    >Can you simply give me the formula.


    The formula I use is:

    Age: DateDiff("yyyy", [DOB], Date()) - IIF(Format([DOB], "mmdd") >
    Format(Date(), "mmdd"), 1, 0)

    John W. Vinson[MVP]
     

Share This Page