Results 1 to 8 of 8
  1. #1
    Middlemarch is offline Competent Performer
    Windows 10 Access 2019
    Join Date
    Mar 2015
    Posts
    344

    Using Format with Date

    Just wondering why Debug.Print Format(Now, "dd/mm/yyyy")
    prints 06, 02, 2023 instead of 06/02/2023 ?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,896
    No idea. I get 05/02/2023.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Middlemarch is offline Competent Performer
    Windows 10 Access 2019
    Join Date
    Mar 2015
    Posts
    344
    Yes, that's what i thought I used to get... but now it's different . Using Office 2019 and find Excel also shows space and comma.
    If I try another computer with Office 2016 it follows the format instruction as expected.
    Is it a bug in Office 2019? Could someone else with this version try please?
    LOL I always thought my Access was bugged as it so often does when I don't want or expect !
    I found something on Google about changing separators, but it said to use File-Options-Advanced. My Access has no "advanced". Is this normal?

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,896
    In Access there is File>Options>ClientSettings>Advanced but nothing there about changing separators.

    Excel has File>Options>Advanced but nothing there about changing date separators.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    Middlemarch is offline Competent Performer
    Windows 10 Access 2019
    Join Date
    Mar 2015
    Posts
    344
    Thanks @June. Same here. Seems separators work as expected here except the for slash characters.

    ? Format(DateAdd("ww", 1, Now), "dd mmm yyyy")
    13 Feb 2023
    ? Format(DateAdd("ww", 1, Now), "dd.mmm.yyyy")
    13.Feb.2023
    ? Format(DateAdd("ww", 1, Now), "dd-mmm-yyyy")
    13-Feb-2023
    ? Format(DateAdd("ww", 1, Now), "dd/mmm/yyyy")
    13, Feb, 2023


    ? Format(DateAdd("ww", 1, Now), "dd, mmm, yyyy")
    13, Feb, 2023
    ? Format(DateAdd("ww", 1, Now), "dd,mmm,yyyy")
    13,Feb,2023
    ? Format(DateAdd("ww", 1, Now), "dd\mmm\yyyy")
    13m02y2344
    ? Format(DateAdd("ww", 1, Now), "dd#mmm#yyyy")
    13#Feb#2023


    ? Format(DateAdd("ww", 1, Now), "dd//mmm//yyyy")
    13, , Feb, , 2023


    ? Format(DateAdd("ww", 1, Now), "dd&&mmm&&yyyy")
    13&&Feb&&2023

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,896
    Try: Format(Now, "dd\/mm\/yyyy")
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    Middlemarch is offline Competent Performer
    Windows 10 Access 2019
    Join Date
    Mar 2015
    Posts
    344
    Nice solution. That did work

    ? Format(Now, "dd\/mm\/yyyy")
    06/02/2023
    But I'm sure it used to work how it does for you. You wonder why/how and what else might have changed.

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,896
    Never seen this.

    You are not in U.S.? Can only guess it has something to do with regional settings.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. 5 Digits Date to Normal Date Format
    By cyliyu in forum Access
    Replies: 7
    Last Post: 02-13-2022, 01:05 PM
  2. Replies: 6
    Last Post: 04-06-2020, 04:31 AM
  3. Replies: 3
    Last Post: 12-30-2016, 10:27 AM
  4. Replies: 3
    Last Post: 08-20-2014, 01:47 PM
  5. Replies: 4
    Last Post: 03-12-2013, 06:49 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