
Originally Posted by
todd2006
jason its giving an error
conversion failed when converting character string to smalldatetime data type
And hence the problem with storing dates as a character string -- you can get goofy data. My guess is that you have something is one or more of the records that doesn't look like a date. If you don't have a lot of records, you can eyeball them (sort on the date column). Otherwise, you can run some queries to try and find the offending date columns, such as:
Code:
Select *
from theTable
where left(std_date , 1) not in ('0','1','2','3','4','5','6','7','8','9')
or length(std_date) <> 10 -- assuming dates in mm/dd/yyyy format
Sooner or later, you will find something that doesn't look dateish.
Bookmarks