Home Forums SQLServerCentral.com Editorials Is It Time To Clear Out Those Quirky Functions? RE: Is It Time To Clear Out Those Quirky Functions?
alan.spillert
Mr or Mrs. 500
Points: 513
More actions
July 15, 2014 at 7:19 am
#1729439
These quirky functions keep us TSQL developers special. The ISNUMERIC tests a field, and CAST converts it if you want.
CASE ISNUMERIC(LEFT(a.[CHBID], 7))
WHEN 1
THEN CAST(LEFT(a.[CHBID], 7) AS INT)
ELSE 0
END AS CHBID