Results 1 to 7 of 7
  1. #1
    jazzy is offline Advanced Beginner
    Windows 10 Office 365
    Join Date
    Nov 2021
    Posts
    77

    Wrong Day of Week

    access office 365. linked table to Azure SQL. data type is set to Date/Time Extended. shows date 10/13/2022 (Thursday) but when i put the format as Long Date it shows the wrong day of the week (Friday).



    SQL is showing Data Type datetime2(0)

    any ideas?

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,945
    Look at the syntax. As one of the arguments is to specify the first day of the week?
    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
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    format("10/13/2022 13:55","ddd")
    should be THU


    WEEKDAY( "10/13/2022 13:55")
    should be 5 (thurs)


    sometimes access gets confused on sql date, you could try trim the value to the true date LEFT([field],....) , then get the DoW.




  4. #4
    jazzy is offline Advanced Beginner
    Windows 10 Office 365
    Join Date
    Nov 2021
    Posts
    77
    it was working fine for months, then all of a sudden yesterday it started happening. only the new version is screwed up, the other versions are working fine. no code was changed on this form. totally confused. if i run a simple query on the table and chnage format to Long Date its incorrect. is it possible that the time is missing that is causing the problems? '13:55' ?

    it seems that Access has changed the new linked tables date fields from Date/Time to Date/Time EXTENDED. is there a way to stop that?

  5. #5
    jazzy is offline Advanced Beginner
    Windows 10 Office 365
    Join Date
    Nov 2021
    Posts
    77
    problem solved....Set user options for the current database (microsoft.com)

    Access File -> Options -> Current Database had 'Data Type Support Options' and Yes was clicked for Support Date Time Extended for Linked/Imported Tables.

  6. #6
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,945
    So are you saying that a time element makes the function see the day as the next day?
    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

  7. #7
    jazzy is offline Advanced Beginner
    Windows 10 Office 365
    Join Date
    Nov 2021
    Posts
    77
    Thats what happened. confuses the hell out of me. it changed all the date/time fields to date/time extended when i linked the databases. then when i used long format the day of the week was off by one day.

    it also wouldn't calculate time. =Format(1+[EndTime]-[StartTime],"Short Time")

    NUTS!!!

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

Similar Threads

  1. Replies: 2
    Last Post: 04-14-2016, 06:30 PM
  2. Replies: 26
    Last Post: 11-05-2015, 01:58 PM
  3. Replies: 9
    Last Post: 06-19-2015, 03:37 PM
  4. Replies: 3
    Last Post: 09-19-2013, 10:18 AM
  5. Week number wrong
    By Nikki17 in forum Queries
    Replies: 6
    Last Post: 03-18-2006, 10:01 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