The best way is to change it to a Date field, but that is not going to be automatic due to the format of your data.
What I would recommend is to add an extra date field (so that you don't lose the original data), and then use a series of Update statements like this one:
(the highlighted parts need to be changed when you re-run it for each month)Code:UPDATE tablename SET datefield = Cast('10/' + RTrim(Left(varcharfield,2)) + '/' + Right(varcharfield,4) as DateTime) WHERE varcharfield Like '%October%'
Note that this syntax is based on SQL Server, the second line will need to change if you are using a different database system.




Reply With Quote