Changing culture Info

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • FishVal
    Recognized Expert Specialist
    • Jun 2007
    • 2656

    #16
    This brings us back to what we've started from.

    The date value is the same, just its visual appearance is in accordance with german regional settings. It is not the Access which "returns date in German format", it is .NET code which formats the date when writing to Console or converting to string. This make problem when you further try to incorporate thus formatted string into SQL expression.

    Comment

    • shnizle
      New Member
      • Apr 2009
      • 16

      #17
      so this brings me back to the original question ,
      is there a way to force access connection to recognize dates formated in en-us only as a temporary solution, or i will have to reconstruct all the project to be generic for all dates and number formats that all i wish to know.

      i am looking for a temporary fast solution to make the project be able to work on every machine no matter what the regional settings are set to, i acknoladge that theres a fundamental problem with the .net code, i'm just looking for something temporary that will solve this issue until i rewrite all the project to be globalized enabled.

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32633

        #18
        Originally posted by shnizle
        ok, it is a date issue :)
        (My computer Regional settings are set to German)
        the problem is when i select for example the following query:
        (i always use M/d/yyyy format)
        Code:
        SELECT * FROM DAILYHISTORY WHERE `dDate` = #1/2/2005#
        i get rows which their dates are 02.01.2005 which is 2/1/2005
        You do realise you've used 1/2/2005 as an example don't you? We still don't have a clear idea of what you're trying to say. Please clarify which date you're talking about :- 1st Feb or 2nd Jan.

        You seem to be saying that Access is not responding to the standard date format for literals in SQL. This I find hard to believe. Are you sure this is a literal date string you're using and not a value specified somehow else (It's only date values embedded within the SQL string itself which work this way)?

        The last item of confusion is the character (`) you use to delineate your field name. I can only assume this is working well for you as, if this were failing then your results would be quite different. In my experience though, the correct way to delineate names within SQL is to use [] characters.

        Comment

        • NeoPa
          Recognized Expert Moderator MVP
          • Oct 2006
          • 32633

          #19
          Originally posted by shnizle
          i am looking for a temporary fast solution to make the project be able to work on every machine no matter what the regional settings are set to, i acknoladge that theres a fundamental problem with the .net code, i'm just looking for something temporary that will solve this issue until i rewrite all the project to be globalized enabled.
          That's a hard question to answer, as SQL is already designed specifically to do just that. There are no regional variations within SQL. The designers realised that having such regional variations would cause this type of problem everywhere. You can't do anything to make the SQL any more region independent.

          Comment

          • shnizle
            New Member
            • Apr 2009
            • 16

            #20
            i said i am using en-us format so 1/2/2005 = january 2nd 2005
            en-us format is - MM/dd/yyyy or in this example : M/d/yyyy

            Comment

            • NeoPa
              Recognized Expert Moderator MVP
              • Oct 2006
              • 32633

              #21
              Originally posted by shnizle
              i said i am using en-us format so 1/2/2005 = january 2nd 2005
              en-us format is - MM/dd/yyyy or in this example : M/d/yyyy
              You also said :
              Originally posted by shnizle
              (My computer Regional settings are set to German)
              plus various other comments that would tend to make the point very ambiguous, which was why I was particularly surprised that you would continue with your explanation simply expressed as 1/2/2005. It's not as if it wasn't already clear that we were having trouble trying to understand what you were saying, after wasting quite a lot of time trying to lead you to express the problem clearly enough to work with.

              To be honest, with that sort of attitude you can continue without any further contributions from me. I see no sign you've read them anyway so I'm sure that won't hurt you.

              Comment

              • DonRayner
                Recognized Expert Contributor
                • Sep 2008
                • 489

                #22
                Shiznle, can't you understand what NeoPa and FishVal are trying to tell you!!!

                When storing a date to a field in access that has it's type set to Date/Time, Access doesn't store the information as dates. It is stored as double precision floating point number. The integer portion represents the date and the decimal portion represents the time. Your problem lays in how your .net code is interpreting this number.

                Here is a link to a MS KB article explaining it.

                Comment

                • shnizle
                  New Member
                  • Apr 2009
                  • 16

                  #23
                  i can see that,
                  but for some reason when my computer regional setting is set to en-us my application works great, on the other hand when i set my computer to Germany ,
                  yet i force the application to work with en-us format it has lots of bugs,
                  so i dont see how it is possible.

                  Comment

                  • shnizle
                    New Member
                    • Apr 2009
                    • 16

                    #24
                    sorry NeoPa i thought i was very clear with all the description i gave you here,
                    it doesn't seem to be so complicated to me.

                    Comment

                    • DonRayner
                      Recognized Expert Contributor
                      • Sep 2008
                      • 489

                      #25
                      Originally posted by shnizle
                      i can see that,
                      but for some reason when my computer regional setting is set to en-us my application works great, on the other hand when i set my computer to Germany ,
                      yet i force the application to work with en-us format it has lots of bugs,
                      so i dont see how it is possible.
                      Maybe try over in the .Net form to see if anybody there has insights on working with dates and different regional settings.

                      Comment

                      • shnizle
                        New Member
                        • Apr 2009
                        • 16

                        #26
                        ok thank you all i didn't mean to disrespect anyone,
                        it seems like i would just have to rewrite the project with no temporary solution that i am looking for.

                        Comment

                        • NeoPa
                          Recognized Expert Moderator MVP
                          • Oct 2006
                          • 32633

                          #27
                          Originally posted by shnizle
                          ok thank you all i didn't mean to disrespect anyone
                          We're good Shnizle. I got a little frustrated, but I'm good now.

                          Comment

                          Working...