Hi All,
What is wrong with this statement. Even when CHARINDEX is zero it goes thru the 2nd case statement:
CASE WHEN CHARINDEX('-',ClientID) <> 0 THEN
(CASE WHEN ISNUMERIC(SUBSTRING(ClientID,CHARINDEX('-',ClientID) + 1, 5)) = 1
THEN CONVERT(INT,SUBSTRING(ClientID,CHARINDEX('-',vchClientSubSessionID) + 1, 5))
ELSE ClientID END)
ELSE ClientID END
Thanks.