Comparing dates, format trouble

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Twanne
    New Member
    • Jul 2007
    • 65

    #1

    Comparing dates, format trouble

    How do you compare dates that are in dd/mm/yyyy format?? Al my dates are stored like this but access keeps checking them by mm/dd/yyy format. When access can't convert my dd/mm/yyyy format, it uses the date i stored.
    If access can convert it to mm/dd/yyyy format and it still is a legal date it does so.

    How do I get around this??

    Greetz
  • Lysander
    Recognized Expert Contributor
    • Apr 2007
    • 344

    #2
    Originally posted by Twanne
    How do you compare dates that are in dd/mm/yyyy format?? Al my dates are stored like this but access keeps checking them by mm/dd/yyy format. When access can't convert my dd/mm/yyyy format, it uses the date i stored.
    If access can convert it to mm/dd/yyyy format and it still is a legal date it does so.

    How do I get around this??

    Greetz
    Shoot Bill Gates. I have had this trouble so many times. You need to make sure that the default date format in Windows is dd/mm/yyyy for all users. Also, if you are running a split database, with code and data on different machines, make sure the default date, for all users, on the server, is dd/mm/yyyy. Up to W2K (and I suspect 2003 as well) the default is mm/dd/yyyy and so when you access the database on the server, the account on the server (I think ISUser but not sure) uses the default American dates, rather than British dates.

    Since coming across this problem some time ago, I now store my dates in 3 fields, day, month, year, store the month as text (eg sep, oct) and then build the date as datevalue.

    Comment

    • Twanne
      New Member
      • Jul 2007
      • 65

      #3
      Ok, get me a rifle and a plane to wherever he lives and I'll be on my way :)

      But thanx anyway, I'll try it out and see if it works. To bad there isn't a programatorical way around it.

      Greetz

      Comment

      Working...