Date format in update query

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • John

    Date format in update query

    Hi

    How can I ensure that date is always assigned in dd/mm/yyyy format to a date
    filed, in an update query?

    Thanks

    Regards


  • Allen Browne

    #2
    Re: Date format in update query

    Access does not store dates in a specific format. The format is applied at
    display time, and depends on the user's Regional Settings (in the Windows
    Control Panel.)

    So perhaps your question is, "How can I ensure that Access understands the
    dates in the query, and stores the correctly when the Update query
    executes?"

    I also live in a d/m/y country, and in 15 years of working with Access have
    found 3 cases where Access is likely to misunderstand our dates. Details in:
    International Date Formats in Access
    at:
    How to ensure dates are interpreted correctly in a Microsoft Access database, even when the user's regional settings are different from the US format.


    If the dates are calculated ones, typecasting them in the query can also
    help:
    Calculated fields misinterpreted
    at:
    Explains how Microsoft Access can misunderstand the intended data type of calculated fields and unbound controls, and explains how to avoid these issues.


    --
    Allen Browne - Microsoft MVP. Perth, Western Australia.
    Tips for Access users - http://allenbrowne.com/tips.html
    Reply to group, rather than allenbrowne at mvps dot org.

    "John" <John@nospam.in fovis.co.uk> wrote in message
    news:ytmdnUAfhp EswQbZnZ2dnUVZ8 qqdnZ2d@pipex.n et...[color=blue]
    >
    > How can I ensure that date is always assigned in dd/mm/yyyy format to a
    > date filed, in an update query?[/color]


    Comment

    • Randy Harris

      #3
      Re: Date format in update query

      * John:[color=blue]
      > Hi
      >
      > How can I ensure that date is always assigned in dd/mm/yyyy format to a date
      > filed, in an update query?
      >
      > Thanks
      >
      > Regards
      >
      >[/color]

      If you are updating a date field, there is no reason to consider the
      format. Dates are always stored as a numeric value. It's only when you
      display the dates that the format is applied.

      --
      Randy Harris
      tech at promail dot com
      I'm pretty sure I know everything that I can remember.

      Comment

      • Paradigm

        #4
        Re: Date format in update query

        in the query string use format(mydate," mm/dd/yyyy")
        that will ensure that the query understands your date.
        Alec

        "John" <John@nospam.in fovis.co.uk> wrote in message
        news:ytmdnUAfhp EswQbZnZ2dnUVZ8 qqdnZ2d@pipex.n et...[color=blue]
        > Hi
        >
        > How can I ensure that date is always assigned in dd/mm/yyyy format to a[/color]
        date[color=blue]
        > filed, in an update query?
        >
        > Thanks
        >
        > Regards
        >
        >[/color]


        Comment

        Working...