Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2004
    Posts
    68

    Unanswered: Im Still Stuck With The Date Thing

    In my database i have a field called Date Of Birth but i need a textbox to say the persons age. the input mask for the Date of Birth s in this format = 00/00/0000

    How would i do i tusing expression builder?

  2. #2
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    ...assuming [date of birth] is stored as an Access date-type, the simplest approach is:

    ApproxAgeDecimalYears = (now() - [date of birth])/364.25

    it is not that far wrong for something so simple.

    if you want something more exotic, you have to decide how do you want to express "age". options include:
    nearest year
    completed years
    decimal years

    what are you looking for?

    izy
    currently using SS 2008R2

  3. #3
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    obviously my calculation should read 365.25 (which i didn't notice until i saw your other post on exactly the same topic). sorry for the error.

    o why do you have quotes around the 365.35 in your other post - they don't belong there.
    = as-posted
    without the quotes should fly.

    o also, a text box should take rudy's SQL without choking, and the SQL provides a more sophisticated view of age than my/your simple calc.

    izy
    currently using SS 2008R2

  4. #4
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    a text box should take rudy's SQL without choking, and the SQL provides a more sophisticated view of age than my/your simple calc.
    thanks, izy

    i know my expression is accurate to the day when used in a query, but i was unable to say how to link or bind or whatever you do to get it attached to a text box (i don't do access forms)
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

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