Importing Dates in MMDDYYYY format from Excel into Access Tables

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Kosmos
    New Member
    • Sep 2006
    • 153

    Importing Dates in MMDDYYYY format from Excel into Access Tables

    Howdy...haven't used Access for a while, but now I'm getting back into it and can't seem to figure out how I can import data from an excel table that outputs the date in the formate of MMDDYYYY. I figure there's gotta be some easy way to do this rather than reading through the string with a mid function or something along those lines. Any help would be greatly appreciated.

    Cheers!
  • FishVal
    Recognized Expert Specialist
    • Jun 2007
    • 2656

    #2
    Originally posted by Kosmos
    Howdy...haven't used Access for a while, but now I'm getting back into it and can't seem to figure out how I can import data from an excel table that outputs the date in the formate of MMDDYYYY. I figure there's gotta be some easy way to do this rather than reading through the string with a mid function or something along those lines. Any help would be greatly appreciated.

    Cheers!
    Nothing to work around. Access normally imports dates from Excel, no matter how they are formatted.

    Kind regards,
    Fish

    Comment

    • Kosmos
      New Member
      • Sep 2006
      • 153

      #3
      Originally posted by FishVal
      Nothing to work around. Access normally imports dates from Excel, no matter how they are formatted.

      Kind regards,
      Fish
      Well the dates in the excel sheet are in a general field and the program that exports this list doesn't export them with delimiters so it would be a value like 10061982 and although I import this field directly into a date field in Access, it gives me an error that it can not be added.

      Comment

      • FishVal
        Recognized Expert Specialist
        • Jun 2007
        • 2656

        #4
        Originally posted by Kosmos
        Well the dates in the excel sheet are in a general field and the program that exports this list doesn't export them with delimiters so it would be a value like 10061982 and although I import this field directly into a date field in Access, it gives me an error that it can not be added.
        I see two options:
        • format cells as dates
        • parse cell content with mid function
          Code:
          dateserial(mid("10061982",5,4),mid("10061982",1,2),mid("10061982",3,2))

        Comment

        • Kosmos
          New Member
          • Sep 2006
          • 153

          #5
          Originally posted by FishVal
          I see two options:
          • format cells as dates
          • parse cell content with mid function
            Code:
            dateserial(mid("10061982",5,4),mid("10061982",1,2),mid("10061982",3,2))
          Hmm looks like I'll have to use the mid...was hoping there would have been a way to avoid that lol. Thanks!

          Comment

          • FishVal
            Recognized Expert Specialist
            • Jun 2007
            • 2656

            #6
            I don't state that there is no "other way" unknown for me. Just in a situation like your one I would go with string functions and nether bother about perfect/easiest ways as soon as after import the data is in suitable type/format.

            Best regards,
            Valentine

            Comment

            • Kosmos
              New Member
              • Sep 2006
              • 153

              #7
              I have absolutely no clue what you meant to say there :)

              Comment

              • FishVal
                Recognized Expert Specialist
                • Jun 2007
                • 2656

                #8
                :)

                Nevermind. I just often have to decide whether to go with possibly not perfect but working solution or to wait until enlighten me.

                Kind regards,
                Fish

                Comment

                Working...