Results 1 to 5 of 5
  1. #1
    ano is offline Advanced Beginner
    Windows 11 Office 365
    Join Date
    Nov 2023
    Posts
    59

    import excel import some wrong date format


    in excel is total sheet a value copy from original sheet , so no formules any more.
    also is cleanup fields not part of functionality.
    because there were problems with dates inserting in new table , the column date in excel is customized .
    analyze during import created 3 table not clear how he did that so not used.
    checking the import as total looks fine.
    form1 has buttons create table rate,abc,earn,compare,all
    without the format in rate and earn vba several records twist dd-mm
    with the format 1 record still lose its time.
    seems that excel value sheet hidden format is imported and not the customized.
    Attached Files Attached Files

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,938
    Date are just that in Excel, Dates as numbers, same as Access.
    How they are displayed is up to you, and your Regional settings.

    So import the dates AS dates and not text.

    Code:
    ? date
    30/12/2023 
    ? cdbl(date)
     45290 
    ? cdbl(now) 
     45290.4249189815
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  3. #3
    ano is offline Advanced Beginner
    Windows 11 Office 365
    Join Date
    Nov 2023
    Posts
    59

    reading problems?

    i date the column in excel to make sure all are same.
    i create table with date
    i change to date during import
    the import looks fine
    vba to create rate and earn --> several mm/dd -->dd/mm but not all
    vba to create rate and earn with format(date,"yyyymmddHHmmss") all seems fine
    BUT 1 RECORD has again no time

  4. #4
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,938
    BUT 1 RECORD has again no time
    So there was no time element to start with!

    Access does not remove elements from for the fun of it.

    Show the excel cell where this errant date exists.
    Make a reference to it in another cell and format that cell as having hh:mm after the date in whatever format your country expects.
    Then post that as well.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  5. #5
    ano is offline Advanced Beginner
    Windows 11 Office 365
    Join Date
    Nov 2023
    Posts
    59
    i corrected the mistake in the copy.values so the import is clean!
    the imported total table looks fine to till u miss records then u find few records with mm/dd --> dd/mm!
    but in the copy.values the date column was different date format to make sure all is fine.
    the problem come in vba where the total sheet/table are split up into rates,abc,earn there few records got dd/mm again!
    after format use in vba insert the dd/mm was solved!!!
    only 1 record lost his time again , available in table total!
    so what u suggest has no meaning at all bec u focussed on what and why not how to solve
    the only way to solve is go in the original sheet and risk not working sheet any more by the many formulas
    the problem is the import seems to copy hidden information that is being used by vba from imported access table to new access tables!
    gud luck to the ppl who also decide to migrate from excel to access

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

Similar Threads

  1. Replies: 9
    Last Post: 08-10-2022, 02:12 AM
  2. Replies: 4
    Last Post: 09-19-2019, 02:13 AM
  3. Replies: 3
    Last Post: 11-18-2015, 02:28 PM
  4. Replies: 1
    Last Post: 06-13-2015, 11:05 AM
  5. Replies: 4
    Last Post: 12-17-2012, 01:21 PM

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