Using SQL, is there an elegant way to remove the 'th' 'rd' and 'st' after a date? Here is how I'm doing it, but I'd rather do something like regex recall (example below).
Please no functions with while loops. I've already seen those solutions and I'm looking for something less ugly.
select Replace('september 8th, 2016', Substring('september 8th, 2016', PatIndex('%[a-z,A-Z][a-z,A-Z],%', 'september 8th, 2016'), 2), '') statdate2
if using recall I could do something like below
/(\s[0-9]+)[a-z,A-Z]{2}\,/
and recall what the date number is with the replacement
$1,
As-is my pattern inthe sql example may pull in any two characters followed by a comma which is good 99% of the time, but does match incorrectly some unwanted date misformats where users put the comma after the month.