Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Date values in insert statement

Author  Topic 

brownd92
Starting Member

8 Posts

Posted - 2005-03-24 : 11:30:36
Guys,
this is my insert statement:

INSERT INTO ObtreeEmail (ID, type, url, email, Supervisor_email, webmasters_email, EmailStatus, sentTime, Modified_date) VALUES(4, 0, 'index', 'Administrator@bt.com', 'Administrator@bt.com', 'Administrator@bt.com', 1, getdate(), 'Thu Nov 04 2004 00:00:00 GMT+0000 (GMT Standard Time)')

However I get the error:

Syntax error converting datetime from character string.


I have tried convert etc, but I cant seem to find the right syntax, or maybe its not possible?
Please help.


David

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2005-03-24 : 11:43:58

Format the date is a way that SQL Server can use.

This is one example:

'2004/11/04 00:00:00'




CODO ERGO SUM
Go to Top of Page
   

- Advertisement -