Results 1 to 5 of 5
  1. #1
    Join Date
    Nov 2002
    Location
    Belgium
    Posts
    243

    Unanswered: Date issue (dd/mm/yyyy versus mm/dd/yyyy)

    Hello all,

    I'm having troubles with a datefield in one of my tables.
    I created a form with a calendarcontrol on it. In the properties of it I defined that system dateformat (which is dd/mm/yyyy) should be used.
    However, after inserting the selected date into my table (datefield defined as short date and even dd/mm/yyyy) my date is :
    - in format mm/dd/yyyy if day is smaller or equal to 12
    - in format dd/mm/yyyy if day is greater than 12
    When I trigger the AfterUpdat-event it shows the correct date.
    Even a debug.print of my SQL-stqtement shows me the correct value.

    Example :
    When I select February 12, 2008 it will put 02/12/2008 in my table.
    When I select February 13, 2008 it will put 13/02/2008 in my table


    Any help / hints would be appreciated. I spent too much time testing and trying, but no success.


    Thanks in advance

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Are the date values corect, just displaying in the wrong format? If so you can just use the Format() function when you want to display it o users.
    George
    Home | Blog

  3. #3
    Join Date
    Nov 2002
    Location
    Belgium
    Posts
    243
    It's not a matter of display --> my values are stored in a mixed way depending on the day.
    - if day <= 12 then DB seems to be confused which part is day and which part is month --> he will take day as month and moth as day
    - if day > 12 then there is no discussion what is month and what is day, so this will be stored correctly

    Even putting format(date, "dd/mm/yyyy") in my SQL-statement gives the same issue.

  4. #4
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Try inserting dates in yyyymmdd format?
    George
    Home | Blog

  5. #5
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    What date format is set in your Regional Settings in the Control Panel of Windows?
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •