Results 1 to 4 of 4
  1. #1
    techexpressinc's Avatar
    techexpressinc is offline Competent Performer
    Windows XP Access 2010 32bit
    Join Date
    Dec 2008
    Location
    Indiana, USA
    Posts
    151

    Help requested for calculating age

    I have a DOB on the database.
    Table = Members
    Field = DOB


    I seen this as a formula - “AgeCalcField: AgeInYears([DOBField], Date())” -

    Within my query I do this
    I click the field box
    and coded an expression as listed here and get a syntax error:
    “AgeCalcField: AgeInYears([Members:DOB], Date())”

    Can someone help in getting the age on my query working?
    Thanks a lot - Russ @ scaninc.org

  2. #2
    Goodge12 is offline Novice
    Windows XP Access 97
    Join Date
    Sep 2008
    Posts
    25

    Cool try this...

    Maybe try this?

    Age: Now()-Members!(DOB)

    Make sure the "Age" field is formatted as a number (long integer).

    Curious to see if this works- please let me know!

  3. #3
    techexpressinc's Avatar
    techexpressinc is offline Competent Performer
    Windows XP Access 2010 32bit
    Join Date
    Dec 2008
    Location
    Indiana, USA
    Posts
    151
    Tried and got the message
    "Expression has a invalid dot "." or "!" operator

  4. #4
    Goodge12 is offline Novice
    Windows XP Access 97
    Join Date
    Sep 2008
    Posts
    25

    ok, this one should work- I tested it

    Create a new field in table Members called "Age". Create an update query. Pull in the "Age" field. For critria, type: "Is Not Null". Where it says "Update To:" type the following;

    (Now()-[Members]![DOB])/365

    This should give you the age in years.

    Here's what it looks like in the SQL View

    UPDATE Members SET Members.Age = (Now()-[Members]![DOB])/365
    WHERE (((Members.Age) Is Not Null));

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

Similar Threads

  1. Calculating a sum on a report
    By missourijc in forum Reports
    Replies: 0
    Last Post: 10-30-2008, 07:21 PM
  2. calculating due dates in access
    By trixxnixon in forum Forms
    Replies: 0
    Last Post: 09-28-2008, 12:35 PM
  3. Replies: 0
    Last Post: 09-25-2008, 12:19 PM
  4. Form calculating troubles
    By Ufalufa in forum Access
    Replies: 0
    Last Post: 11-27-2007, 10:36 PM
  5. Calculating Values
    By Jahan in forum Queries
    Replies: 1
    Last Post: 07-09-2006, 09:15 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