Results 1 to 3 of 3
  1. #1
    FNey is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2016
    Location
    USA
    Posts
    2

    Creating a calculated table field


    I want to create an Access2010 table field that calculates a persons age from a Date of Birth date field (preferably without using code/query). Anything I've tried (i.e Date of birth minus one of the basic built in date functions, fail). any help would be greatly appreciated. Please be explicit.

  2. #2
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    The short answer is - Don't! This is a value that changes every day. Rather create a standard query that calculates age and refer to it whenever you need to display the value.

    See here: http://www.fontstuff.com/access/acctut05.htm

  3. #3
    Join Date
    Apr 2017
    Posts
    1,679
    On fly:

    =Year(Date) - Year(Birthday) - Iif(DateSerial(Year(Date),Month(Birthday),Day(Birt hday))>Date,1,0)

    (There is a problem with 29. February when birthday is on 29. February, in current year February has 28 days, and current date is 1. March.)

    Not that I advise to put it into table

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 5
    Last Post: 05-13-2016, 11:00 AM
  2. Help with creating a calculated field in a query
    By Seahawk114 in forum Access
    Replies: 2
    Last Post: 08-13-2013, 05:23 PM
  3. Replies: 3
    Last Post: 02-13-2013, 10:15 AM
  4. Receiving Error when creating Calculated Field
    By hydrojoe11 in forum Access
    Replies: 4
    Last Post: 02-04-2013, 08:01 PM
  5. Creating a Calculated Field Using IIF or NZ
    By rjwell in forum Queries
    Replies: 1
    Last Post: 09-09-2011, 07:32 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums