Date type to SQL Server 2000 datetime field

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

    #1

    Date type to SQL Server 2000 datetime field

    Hi I am trying to add parameters to pass to a stored procedure in SQL
    Server 2000, I am stuck on the DateTime field value. What do I need to
    do in my application with the Date type field so I can pass its value
    successfully to the DateTime field in SQL Server?

    Thanks


    Nick




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

    #2
    Re: Date type to SQL Server 2000 datetime field

    "'" + MyDateTime.ToSt ring() "'"

    or

    "'" + MyDateTime.ToSh ortDateString() + "'"

    This works in SQL INSERT statements. You just have to treat it like
    text. SQL Server does the rest.

    Nick <anonymous@devd ex.com> wrote in message news:<OWQTSCmoD HA.964@TK2MSFTN GP10.phx.gbl>.. .[color=blue]
    > Hi I am trying to add parameters to pass to a stored procedure in SQL
    > Server 2000, I am stuck on the DateTime field value. What do I need to
    > do in my application with the Date type field so I can pass its value
    > successfully to the DateTime field in SQL Server?
    >
    > Thanks
    >
    >
    > Nick
    >
    >
    >
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    > Don't just participate in USENET...get rewarded for it![/color]

    Comment

    • Nick

      #3
      Re: Date type to SQL Server 2000 datetime field


      Thanks very much that is now working fine :-)


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

      Comment

      Working...