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

    Unanswered: Working Out Someones Age

    Please Help!

    I have made a database for a school project and i need it to be ble to work out the date. I have made a field that says their date of birth but i cant work out how to do it using the expression builder.

    All i can think of is date()-[Date Of Birth]/"365.25" but it says its wrong!

    PLEASE HELP!!

  2. #2
    Join Date
    Jan 2004
    Location
    The Netherlands
    Posts
    421
    for 1 thing if you want to calc use numbers and dont make it a string by using " "

    2nd to get a diff in years between two dates .... Look into the datediff function.....

  3. #3
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    yeah, tricky

    use year(date()) - year([Date Of Birth])
    - iif(month(date())>month([Date Of Birth]),0,
    iif(month(date())<month([Date Of Birth]),1,
    iif(day(date())<day([Date Of Birth]),1,0)))
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  4. #4
    Join Date
    Jan 2004
    Posts
    68

    I mean somthing else

    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

  5. #5
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    did you try my solution? what happened?

    ( i don't do text boxes or 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
  •