Results 1 to 8 of 8
  1. #1
    diegomarino is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2018
    Posts
    434

    export to excel-date problem

    Is it not the first time i had this problem, but why if i export my table in excel, then link the excel in a linked table, all the dates are messed up?
    in some cases dates are the same in excel and access but the query consider them different, and i can fix it by clicking on the excel celles (one by one), the date value stay the same but when i make the query in access it works, and the program can find the match


    this is so weird

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,549
    How is the date messed up? is it not a date?

    Excel will 'guess' at what's in the field. If the 1st few fields dont look like dates, then it will assign them a different datatype.
    same if a field has both numbers and strings, so it guesses that the field is numeric, then the string data will show as #Error, so you must 'hard wire' the field with a leading single quote to force it as string.

    so make sure your date values are actually date values.

  3. #3
    diegomarino is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2018
    Posts
    434
    they are for sure. in my real database happens a very strange thing: the date is the same (e.g. 13/04/2021 11:00:00), but the query consider it as different values. If i click in the cells of excel file that row do not change the date but it "heals" the value and the query recognize it as same value. could be some different setting of date/time? it is so strange, only a bunch of tables have this issue

  4. #4
    diegomarino is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2018
    Posts
    434
    i solved it using a power query in escel instead of exporting
    that's a mistery that will never be solved
    thanks

  5. #5
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,235
    The issue might be caused by the difference between the reference first date between Access and Excel date systems. Access dates start on December 30, 1899 and Excel has either January 1, 1900 or January 1, 1904. The question is why clicking the cell "fixes" it.

    https://sfmagazine.com/post-entry/ju...2031%2C%201899.

    https://docs.microsoft.com/en-us/off...04-date-system
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  6. #6
    diegomarino is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2018
    Posts
    434
    i knew it was some strange reason. Now i'm aware of it, thanks

  7. #7
    Micron is online now Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,369
    The question is why clicking the cell "fixes" it.
    Maybe because that exposes the cell value rather than what the format is? If so, it's interesting that it doesn't revert back to the format when the cell loses focus. Or does it?
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  8. #8
    diegomarino is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2018
    Posts
    434
    it doesn't, it "heals" the cell
    however in naples we say "attacc o ciucc a ro va o padron" that means "tie the donkey where the master wants", so i just do what excel wants and question no more

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

Similar Threads

  1. Export to Excel Using Date/Time Stamp
    By RunTime91 in forum Access
    Replies: 5
    Last Post: 09-24-2018, 05:34 PM
  2. Date out of range error on Excel Export
    By RCG in forum Import/Export Data
    Replies: 1
    Last Post: 05-09-2016, 05:05 PM
  3. Replies: 3
    Last Post: 06-18-2013, 01:14 PM
  4. Export Report to Excel without Date() and Time()
    By agent- in forum Import/Export Data
    Replies: 5
    Last Post: 12-21-2011, 08:55 AM
  5. Access date export to excel
    By jituknows in forum Access
    Replies: 1
    Last Post: 02-05-2011, 01:32 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