Date format problem

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

    Date format problem

    Hi all,

    Im having date format in my ms sql server 2000
    database. I always get a problem in inserting or updating
    data because of my date format. Im taking the value of
    date from textbox. This is how the code:

    dim d as date
    d = txtDate1.Text

    and the sql string is like this

    sqlStr1 = "INSERT INTO CONTACT Values( " & _
    d.ToShortDateSt ring & ",'" & txtName.Text
    & "')"

    The error is with the date format.
    Anyone have any idea about this problem

    Thanks

    But

  • Sparky Arbuckle

    #2
    Re: Date format problem

    What is the name of your Date Field in your database. I know that date
    is a reserved word in Access.

    Have you tried:

    dim d as string

    Comment

    • Red

      #3
      Re: Date format problem

      You must save format as MM/dd/yyyy not dd/MM/yyyy
      [color=blue]
      >-----Original Message-----
      >What is the name of your Date Field in your database. I[/color]
      know that date[color=blue]
      >is a reserved word in Access.
      >
      >Have you tried:
      >
      >dim d as string
      >
      >.
      >[/color]

      Comment

      • Patrick Olurotimi Ige

        #4
        Re: Date format problem

        HerrYAndi
        Guess it would be better if u write a stored procedure for ur SQl
        insert!
        Patrick




        *** Sent via Developersdex http://www.developersdex.com ***
        Don't just participate in USENET...get rewarded for it!

        Comment

        Working...