+ 1
How to add date as a column in SQL server?
I want to add date column in my SQL table. It is giving me the error: cannot find the data type DATE. I tried writing: Create table employee( EmpID varchar(10), RetireDate DATE, Branch Varchar(20)); I also tried writing the date data type as: RetireDate Date RetireDate date RetireDate DATE(YYYY/MM/DD) RetireDate date(yyyy/mm/dd) But everytime it is giving the same error.
3 Answers
+ 4
Perhaps it's because of the Compatibility Level.
https://stackoverflow.com/questions/1685026/problem-with-date-type-in-sql-server
+ 2
Previous SQL Server versions only support the datetime and smalldatetime data type.
+ 1
smalldatetime and datetime both worked.
Thank you