|
-
Jun 18th, 2004, 01:51 AM
#1
Thread Starter
Hyperactive Member
SOLVED: Converting string to datetime in SQL Server
I try to do this:
Code:
rs.open "INSERT INTO tblY (dt) VALUES(CONVERT(DateTime, '190504072400'))", cn, and so on
However, this won't work. Also trying to insert the same, but then formatted ("19-05-04 07:24:00 ") in the same query won't work. When I use GETDATE() (an sql server function), the date is inserted in the format I've set in red. Why can't I do that manually?
Anyone? Thanx...
Last edited by JMvVliet; Jun 21st, 2004 at 01:31 AM.
-
Jun 18th, 2004, 07:33 AM
#2
Try this:
VB Code:
rs.open "INSERT INTO tblY (dt) VALUES('2004-05-19 07:24:00'))", cn, and so on
That should work, the conversion is done automatically
-
Jun 21st, 2004, 01:30 AM
#3
Thread Starter
Hyperactive Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|