View Single Post
 
Old August 19th, 2008, 10:37 PM
Jeff Moden Jeff Moden is offline
Friend of Wrox
Points: 1,536, Level: 15
Points: 1,536, Level: 15 Points: 1,536, Level: 15 Points: 1,536, Level: 15
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2006
Location: , MI, USA.
Posts: 475
Thanks: 0
Thanked 9 Times in 9 Posts
Default

Try CAST('2015' AS DateTime) and see what happens... it's why the ISDATE function is a bit fickle...

... Dunno because I haven't tested it on a million rows, yet, but I'm thinking the CharIndex/3 method will beat the Cast method because there's no conversions... nicely done.

--Jeff Moden