Results 1 to 5 of 5

Calculating Age based on DOB format YYYYMMDD

  1. #1
    thewatcher101 is offline Novice
    Windows 10 Access 2016
    Join Date
    Nov 2017
    Location
    Los Angeles
    Posts
    4

    Calculating Age based on DOB format YYYYMMDD


    I am having calculating current age because the birthdays are saved in that format.

  2. #2
    RuralGuy's Avatar
    RuralGuy is online now Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,643
    Use DateSerial() to change it to a date with string functions (Left, Mid, Right).
    (RG for short) aka Allan Bunch Previous MS Access MVP - WinXP Pro, Win7 Pro Win10 Pro - acXP, ac07, ac10, ac13
    How to mark the thread as Solved!
    Teaching is not filling a bucket but lighting a fire.
    Borrowed quote..."Docendo discimus"

  3. #3
    ranman256's Avatar
    ranman256 is online now VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    5,618
    convert to a real date
    vDat = mid([field],5,2) & "/" & mid([field],7,2) & "/" & left([field],4)

    vAge = DateDiff("yyyy",vDat,Date())

  4. #4
    thewatcher101 is offline Novice
    Windows 10 Access 2016
    Join Date
    Nov 2017
    Location
    Los Angeles
    Posts
    4
    Thank ranman, problem solved.

  5. #5
    thewatcher101 is offline Novice
    Windows 10 Access 2016
    Join Date
    Nov 2017
    Location
    Los Angeles
    Posts
    4
    I notice that the date is not accounted for in the calculations. So someone who was born 11/30 given today is 11/11 is round off, is there way to get date into the calculations?

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

Similar Threads

  1. How to covert yyyymmdd to mm/dd/yyyy
    By adnancanada in forum SQL Server
    Replies: 6
    Last Post: 10-20-2017, 03:30 PM
  2. Bulk convert DDMMYYYY to YYYYMMDD?
    By abm in forum Access
    Replies: 13
    Last Post: 08-20-2015, 12:06 PM
  3. Calculating from a query based subform
    By keiath in forum Forms
    Replies: 1
    Last Post: 10-09-2013, 01:59 AM
  4. Replies: 1
    Last Post: 09-06-2011, 04:24 AM
  5. Convert date format yyyymmdd for datediff
    By TEN in forum Programming
    Replies: 1
    Last Post: 06-17-2009, 08:35 PM

Posting Permissions

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