How to copy 6 of13 digits into another field?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • neelsfer
    Contributor
    • Oct 2010
    • 547

    #1

    How to copy 6 of13 digits into another field?

    how can one copy the first 6 digits of an Identity number field (yymmdd) (ie 6302185140091)in a table, into a separate birthdate field in the same table and add it in the format ddmmyyyy (18021963)
    thx
  • nico5038
    Recognized Expert Specialist
    • Nov 2006
    • 3080

    #2
    This can be achieved by using the LEFT() and CDate() function.
    Just check these.

    Another normalization issue is why to record this birthday field when i's already in the code, or better why have it in the code and not create the combined code when needed...

    Nic;o)

    Nic;o)

    Comment

    • neelsfer
      Contributor
      • Oct 2010
      • 547

      #3
      I would like to only capture the IDno and not both, as the age is calculated from the birthdate. The IdNo however is a primary key and is required.

      Comment

      • nico5038
        Recognized Expert Specialist
        • Nov 2006
        • 3080

        #4
        You lose me, as you started asking for the first six digits (birthday) and didn't mention the IDno.
        Both however are extractable using the LEFT(), RIGHT() and/or MID() function.
        Dateserial() can be used to construct the needed date.

        Nic;o)

        Comment

        Working...