Results 1 to 4 of 4
  1. #1
    mlrucci is offline Competent Performer
    Windows 7 64bit Office 365
    Join Date
    Apr 2018
    Posts
    202

    update qry to change Excel General to Access Short Date

    Good afternoon, I am struggling with converting a string (formatted as "general") from an excel spreadsheet to short date in access. Let me explain. The data is coming from a backend source. Unable to change the format. It is importing to an excel spreadsheet in which I am then importing to my db. It is being imported as short text (string). Unable to convert on import. I have in the past done an update qry to convert to short test to short date. There are 129 different spreadsheets which result in 500,000 records. I need have the ability to remove dates outside my date range. In order to do that, I need to convert the date in the imported table to a short date. I have attempted to do the DateValue() (works great on the other tables) and even attempted to append to another table with different format. Unsuccessful to say the least. There are two problems I am encountering.


    1. I am unable to convert the original format (2022-01-05 03:35:12.3200000000) to short date
    2. When attempting to update, there isn't enough memory. In doing research, it appears the system is attempting to copy the table and with that many records, there isn't enough memory.

    Suggestions?

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    How about:

    ?datevalue(left("2022-01-05 03:35:12.3200000000",10))
    1/5/2022
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    mlrucci is offline Competent Performer
    Windows 7 64bit Office 365
    Join Date
    Apr 2018
    Posts
    202
    Perfect. totally forgot about left. Thank you very much!!!

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Happy to help!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Convert date from short date to general date
    By cebrower in forum Access
    Replies: 4
    Last Post: 04-24-2019, 08:08 AM
  2. Replies: 7
    Last Post: 04-07-2017, 02:08 AM
  3. Replies: 1
    Last Post: 06-25-2016, 02:00 PM
  4. Convert Short text column to date ms access
    By SameerSarswat in forum Access
    Replies: 3
    Last Post: 10-09-2014, 10:42 AM
  5. Link to Excel; number of records change and Excel can't update
    By crobaseball in forum Import/Export Data
    Replies: 5
    Last Post: 03-22-2014, 11:40 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