Results 1 to 8 of 8
  1. #1
    Join Date
    Jan 2004
    Posts
    11

    Unanswered: date format of queries

    I am posting from Eurpoe so i use the date format dd/mm/yyyy. I have set each field in the database to accept this date format however when i write a query using a date from an unbound text box some of the dates are converted to american.
    for example:
    if i entered 05/02/2004 in the text box and ran a macro to insert it in a table it is entered 02/05/2004
    however if the date was 23/04/2004 it is entered correctly as the conversion would make no sense.

    I cant find a solution to this problem, how can i prevent access converting these dates?

    thanks

  2. #2
    Join Date
    Sep 2003
    Location
    T.O.
    Posts
    326
    Check your computer's regional settings. If you used the default from the OS install, it's US. You can change your date options there.
    All code ADO/ADOX unless otherwise specified.
    Mike.

  3. #3
    Join Date
    Jan 2004
    Posts
    11
    The date format of the computer is european and access definately reads it as dd/mm/yyyy as this format is returned when i call the access function Date, this problem is really baffling me!

  4. #4
    Join Date
    Sep 2003
    Location
    T.O.
    Posts
    326
    And your table / form control format settings align with dd/mm/yyyy?
    All code ADO/ADOX unless otherwise specified.
    Mike.

  5. #5
    Join Date
    Jan 2004
    Posts
    11
    Yes, i checked that when i realised what access was doing. Everything is in the correct fomat.
    if i enter 02/05/2004 in the text box and view the query
    with a message box it is the correct format in that query yet when i run the query and view the date in the table the date is in american format.

  6. #6
    Join Date
    Sep 2003
    Location
    T.O.
    Posts
    326
    Try using the Format function and see if you get the expected results:

    Format([YourDate], "dd/mm/yyyy")

    If you get the expected results, then at least your info is being stored correctly, and you can present it with the format fn.
    All code ADO/ADOX unless otherwise specified.
    Mike.

  7. #7
    Join Date
    Jan 2004
    Posts
    11
    Ive tried your suggestion but it still write it in american format. Can you think of anything else?

    Thanks for your help

  8. #8
    Join Date
    Sep 2003
    Location
    T.O.
    Posts
    326
    Nope, using that format function with those options should put the dd and mm where you want them.
    All code ADO/ADOX unless otherwise specified.
    Mike.

Posting Permissions

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