Page 1 of 2 12 LastLast
Results 1 to 15 of 27
  1. #1
    Behedwin is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Sep 2016
    Posts
    61

    Birthday formula?


    Hi

    I am setting up a access app in sharepoint.

    Users in this app will enter a birthdaye and some other numbers.
    I want display a date based on the first 8 numbers.

    For example an user will write
    196510014838
    that means 1995 year, october, day one, and then some other numbers.

    so how can i in this view (see picture)
    http://prntscr.com/cpntgn


    fix so that a date is displayed in a textbox based on those numbers?

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    It looks to me like it would be 1965 rather than 1995.

  3. #3
    Behedwin is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Sep 2016
    Posts
    61
    yeh ofc
    i just typed wrong.

    but how do i get access app to read the field with the number 196510014338 and display a date based on the first 8 numbers?
    4 first is year
    then 2 is month
    and last 2 is day

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    How about:
    DateValue(Mid(YourString,4,2) & "/" & Mid(YourString,6,2) & "/" & Left(YourString,4))

  5. #5
    Behedwin is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Sep 2016
    Posts
    61
    But how do i apply that http://prntscr.com/cpqjkb The code does not seem to save, next time i open the window it is gone. And i guess i need to tell it somehow from where to fetch the numbers it should display...

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Quote Originally Posted by Behedwin View Post
    I guess i need to tell it somehow from where to fetch the numbers it should display...
    That's the ticket.

  7. #7
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Where were you planning to get the string and where were you going to display the Date?

  8. #8
    Behedwin is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Sep 2016
    Posts
    61
    I am using Access app The user input the string into a textfield. That string i want to fetch and transform into a date. Display the string/date in an label. But i can not get the formulas to work like they do in excel. I get this formula to work =Left([PersonnummerTextruta],4) but then i only get the 4 first digits. I can not figure out how to get more and divide them up into a date

  9. #9
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Have you tried:
    =DateValue(Mid([PersonnummerTextruta],4,2) & "/" & Mid([PersonnummerTextruta],6,2) & "/" & Left([PersonnummerTextruta],4))

  10. #10
    Behedwin is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Sep 2016
    Posts
    61
    dont really know if that works. i have a hard time translating datevalue and mid to swedish access....

  11. #11
    Behedwin is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Sep 2016
    Posts
    61
    when googling for translations i get datumvärde extext but those are not recognized in access... its like those commands cant be used in access.

  12. #12
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922

  13. #13
    Behedwin is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Sep 2016
    Posts
    61
    this feels so wierd....

    stuck because of a language barrier.... cant google my way to a access translation of MID function.
    All pages talk about Excel translations... and those does not seem to work.

    =DATUMVÄRDE(EXTEXT([PersonnummerTextruta],4,2) & "/" & EXTEXT([PersonnummerTextruta],6,2) & "/" & VÄNSTER([PersonnummerTextruta],4))


    http://prntscr.com/cq2nrv

  14. #14
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Can you try some of those by them selves in the immediate window? What does this get you?
    ?EXTEXT("196510014838",4,2)

  15. #15
    Behedwin is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Sep 2016
    Posts
    61
    Here is what i did.

    1. Open the app in access
    http://prntscr.com/cq3n5n'
    2. Add a test label
    http://prntscr.com/cq3ne1
    3. Add the formula to the label
    http://prntscr.com/cq3nqh


    Save and run the application.
    The result is nothing, still just say Label 4 in label.


    But if i do the same thing
    But change the formula to =Vänster( [PersonnummerTextruta]; 4)

    Then i get an result. Also notice in the screenshot that the formula VÄNSTER (LEFT in english) is recognized and found by access.
    EXTEXT is not found by Access.

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Calculate age based on birthday
    By MediaCo in forum Access
    Replies: 10
    Last Post: 10-14-2014, 01:00 PM
  2. Just want a plain Birthday Report
    By Palomino33 in forum Queries
    Replies: 7
    Last Post: 11-03-2011, 05:29 PM
  3. Birthday Expression
    By cassidym in forum Queries
    Replies: 7
    Last Post: 03-17-2011, 05:52 AM
  4. Birthday format
    By endri81 in forum Forms
    Replies: 1
    Last Post: 02-12-2011, 04:07 PM
  5. Calendar Birthday Question
    By kirklandwater123 in forum Access
    Replies: 4
    Last Post: 10-29-2010, 11:20 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
  •  
Other Forums: Microsoft Office Forums