Poorly formed cast function.

An expression contains a bad CAST function. For more information, see CAST and CONVERT (Transact-SQL).