Format input date for passing to database

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • AricC
    Recognized Expert Top Contributor
    • Oct 2006
    • 1885

    #16
    I really think the combo boxes would be the best way for you to get your data in the correct format. If you need some help why not go post over in the ASP forum (Classic or .Net) we would be happy :) to help you with this over there.

    Aric

    Comment

    • MMcCarthy
      Recognized Expert MVP
      • Aug 2006
      • 14387

      #17
      Originally posted by AricC
      I really think the combo boxes would be the best way for you to get your data in the correct format. If you need some help why not go post over in the ASP forum (Classic or .Net) we would be happy :) to help you with this over there.

      Aric
      If you like Holdstrong I can transfer this whole thread accross for you. Let me know.

      Mary

      Comment

      • Holdstrong
        New Member
        • Feb 2007
        • 11

        #18
        Yeah, I think this has definitely gone from an Access issue, to an ASP issue.

        Comment

        • NeoPa
          Recognized Expert Moderator MVP
          • Oct 2006
          • 32645

          #19
          Originally posted by Holdstrong
          Yeah, I think this has definitely gone from an Access issue, to an ASP issue.
          I'll do that for you now.
          If I only understood the other side I'm sure we could get your issue sorted.
          Just as some reading up material, specifically on the Access side of things, check out (Literal DateTimes and Their Delimiters (#).).
          And for a little more general background info (Quotes (') and Double-Quotes (") - Where and When to use them.).

          Comment

          • MMcCarthy
            Recognized Expert MVP
            • Aug 2006
            • 14387

            #20
            This question has been moved over from the access forum as the question has become an ASP issue.

            Mary

            Comment

            • Holdstrong
              New Member
              • Feb 2007
              • 11

              #21
              Originally posted by mmccarthy
              This question has been moved over from the access forum as the question has become an ASP issue.

              Mary
              Thanks for the move :)

              I am going to set up a replicate page without our login procedures to continue to work on this today and hopefully give potential helpers an actual working example to see.

              Comment

              • Holdstrong
                New Member
                • Feb 2007
                • 11

                #22
                Ok, my brain is slightly fried today and I have to leave this to work on other stuff now, but I think I have a test page up which at least demonstrates that the ASP page is in fact translating dates correctly and that it IS possible to convert the dates entered into the form before passing them on.

                Here is the page: Test Page

                I used the suggested correctDate code supplied in the linked thread.

                Now, unless I am totally thinking about this wrong, all I need to do is figure out how to send the correctDate to the database instead of the forms "mydate1"

                Comment

                • Holdstrong
                  New Member
                  • Feb 2007
                  • 11

                  #23
                  Thanks for the help. I certainly have a much better handle of the problem now thanks to a lot of you.

                  Here was my solution.

                  I run the following code at the top of my page (thanks to person who posted this in the linked thread):

                  Code:
                  correctDate = day(request("mydate1")) & "-" & monthName(month(request("mydate1"))) & "-" & year(request("mydate1"))
                  correctEnddate = day(request("enddate")) & "-" & monthName(month(request("enddate"))) & "-" & year(request("enddate"))
                  And then, change this:

                  Code:
                  objrs.fields("date") = request.form("mydate1")
                  objrs.fields("end_date") = request.form("enddate")
                  To this:

                  Code:
                  objrs.fields("date") = correctDate
                  objrs.fields("end_date") = correctEnddate
                  And bam, I am now converting the US Standard mm/dd/yyyy that my users enter to the semi-unambiguous dd/mmm/yyyy and sending THAT along to my Db instead. The Db is accepting it correctly and stores and then displays it correctly.

                  Comment

                  • MMcCarthy
                    Recognized Expert MVP
                    • Aug 2006
                    • 14387

                    #24
                    Glad you got it to work out and thanks for posting the solution.

                    Mary

                    Comment

                    Working...