-
error nvarchar into smalldatetime
Hi !
I am having a problem with MS SQL 2005
for a column
[DateInsert] [smalldatetime] NOT NULL
and that Query
INSERT INTO Users (DateInsert) VALUES (CONVERT(DATETIME,'2007-12-17',120))
I am getting a conversion error : nvarchar into smalldatetime
it seems that I am getting this error only with days > 12
2007-12-17 does not work but 2007-12-01 works
any idea ?
thank you
-
You are trying to insert DATETIME value into SMALLDATETIME Column
Try this
INSERT INTO Users (DateInsert) VALUES CAST('2007-12-17' as SMALLDATETIME)
-
CAST ? thank you skhanal
I could anyway solve my problem with yyyyMMdd
INSERT INTO Users (DateInsert) VALUES ('20071217')
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
|
|