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.
Printable View
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.
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)