Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2002
    Posts
    4

    Unanswered: Calculating age, is this valid?

    Came up with an expression in a QBE pane for age, using a Date-of-Birth field...

    Age:INT((Now()-[DOB])/365.25)

    This seems to be generating accurate results...any objections from the pros out there. If Access is returning a value in days when you subtract one date from another, then dividing by 365.26 (accounting for leap years) would seem to be an accuate counter of age)

    Tony

  2. #2
    Join Date
    Sep 2002
    Location
    Land of OZ
    Posts
    173

    Re: Calculating age, is this valid?

    Yeh ... thats it ...

    Originally posted by twinton
    Came up with an expression in a QBE pane for age, using a Date-of-Birth field...

    Age:INT((Now()-[DOB])/365.25)

    This seems to be generating accurate results...any objections from the pros out there. If Access is returning a value in days when you subtract one date from another, then dividing by 365.26 (accounting for leap years) would seem to be an accuate counter of age)

    Tony

  3. #3
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    that's close enough for most purposes

    it won't work for certain cases (e.g. children born a year ago with no february 29 in between)


    rudy

Posting Permissions

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