Reputation: 321
when i try this query in the sql server query edit
INSERT INTO table ( postdate) Values (07/09/2010 )
or
INSERT INTO table ( postdate) Values (cast (07/09/2010 as datetime)
it insert this 1/1/1900 12:00:00 AM
so why i'm missing here???
Upvotes: 0
Views: 3719
Reputation: 432261
07/09/2010
= 7 divided by 9 divided by 2010 with integer arithmetic
This of course gives zero which is 01 Jan 1900 00:00:00.000
Use SQL Server "safe" ISO (yyyymmdd) + delimiters
INSERT INTO table ( postdate) Values ('20100907')
Upvotes: 2