Results 1 to 2 of 2
  1. #1
    NickP is offline Novice
    Windows XP Access 2007
    Join Date
    Jan 2012
    Posts
    1

    Trouble importing date from CSV

    Hi, I'm having trouble importing a date field directly into Access from a CSV file. The problem is that no matter how I play with the data import parameters, I get a type conversion failure.



    If, on the other hand I open the file in Excel, import the field as a date field, manually format the values into the desired date format, then resave the CSV, I can import the date field into Access just fine.

    Here is an snippet of how the data appears in the CSV file. Any help would be appreciated.

    ,2011-11-24 19:45:54.523000000,

    Note - I did try manually deleting the decimal and trailing digits (e.g. .523000000) in the data above. That still didn't fix the problem.

  2. #2
    pdebaets is offline Competent Performer
    Windows Vista Access 2010 (version 14.0)
    Join Date
    Jul 2010
    Location
    Los Angeles
    Posts
    235
    Import it as a text field, then parse it into a date field in your table.

    The CDate function may help.

    Ex.:

    currentdb.execute "Update MyTable set MyDateField = CDate(Left(MyDateImportTextField, 19));", dbseechanges + dbfailonerror

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

Similar Threads

  1. Date diff trouble
    By Cran29 in forum Queries
    Replies: 3
    Last Post: 03-11-2011, 01:02 PM
  2. Trouble with (R)
    By NOTLguy in forum Access
    Replies: 3
    Last Post: 10-29-2010, 11:55 AM
  3. Iff trouble
    By JackT in forum Access
    Replies: 3
    Last Post: 08-18-2010, 02:28 PM
  4. Problem with date when importing
    By ds_8805 in forum Import/Export Data
    Replies: 5
    Last Post: 01-27-2010, 02:30 AM
  5. Showing date and time when importing to access
    By timpepu in forum Import/Export Data
    Replies: 0
    Last Post: 05-07-2009, 07:13 AM

Tags for this Thread

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