Whats the difference in SQL 2008 between datetime and smalldatetime?
Posted on 2010-09-20
I have a statement that now throws an error since I migrated to SQL 2008 from MS SQL 2000.
SQL Statement reads
SELECT PhoneNumber, Message, DateSent,TimeSent, UserName, Originator, MessageStatus FROM messagelog WHERE DateSent >= '21/09/2010' AND DateSent <='21/09/2010' AND MessageStatus LIKE '%%' AND UserName = '' ORDER BY DateSent Desc ;
Microsoft OLE DB Provider for SQL Server error '80040e07'
The conversion of a varchar data type to a smalldatetime data type resulted in an out-of-range value.
When I try to chage the data type to Datetime in the database , MSSQL 2008 says the table would have to be droped and recreated and it cannot do that.
What can I do to solve this?