dfd.francisco 53179 - Friday, August 10, 2018 2:05 AM
What do you mean by that? If you have the option to redesign the table then that's what you should do. Store dates as dates. Even if performance is worse, it's still working as it should. If you can't change the table, then try taking the hyphens out of the stored dates. I couldn't replicate that myself, but I think I've heard reports that sometimes the hyphen stops the date from being convertible.
SELECT CAST('2018-08-10 09:16:57.803' AS datetime)
SELECT CAST('20180810 09:16:57.803' AS datetime)
John