Skip to main content
formatting
Source Link
rink.attendant.6
  • 46.7k
  • 64
  • 111
  • 161

select CASE WHEN TRY_CONVERT(bigint,Mtrl_Nbr) = 0 THEN '' ELSE substring(Mtrl_Nbr, patindex('%[^0]%',Mtrl_Nbr), 18) END

select CASE WHEN TRY_CONVERT(bigint,Mtrl_Nbr) = 0 THEN '' ELSE substring(Mtrl_Nbr, patindex('%[^0]%',Mtrl_Nbr), 18) END 

select CASE WHEN TRY_CONVERT(bigint,Mtrl_Nbr) = 0 THEN '' ELSE substring(Mtrl_Nbr, patindex('%[^0]%',Mtrl_Nbr), 18) END

select CASE WHEN TRY_CONVERT(bigint,Mtrl_Nbr) = 0 THEN '' ELSE substring(Mtrl_Nbr, patindex('%[^0]%',Mtrl_Nbr), 18) END 
Source Link

select CASE WHEN TRY_CONVERT(bigint,Mtrl_Nbr) = 0 THEN '' ELSE substring(Mtrl_Nbr, patindex('%[^0]%',Mtrl_Nbr), 18) END