Results 1 to 2 of 2

Thread: Converting a text value

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2002
    Posts
    10

    Question Converting a text value

    I need to convert the following string into a SQL datetime data type.

    "12-dec-2002 1243"

    Anyone no how I can do this without splitting it up into a vbdate and vbtime. I would like to do it together.

  2. #2
    Let me in .. techyspecy's Avatar
    Join Date
    Aug 2002
    Location
    Back to VBF.
    Posts
    2,456
    What do you mean by splitting ?????

    You can just directly format it and insert it into SQL Server field.
    You can use VB's Format function or SQL's CAST and CONVERT functions. For CAST And CONVERT consult SQL help. There is SQL documentation on this. And its pretty easy.

    Or use format function.

    dim Temp as string

    temp = "12-dec-2002 1243"

    format(temp,"dd-MMM-yyyy hh:mm:ss AMPM)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width