Forum Replies Created

Viewing post 1 (of 1 total)

  • RE: Trimming Last 3 Numbers from some Records

    Hi,

    I think below one will be the easiest way to query your data

    SELECT <Col_Name>,CASE WHEN PATINDEX('%[0-9]%',REVERSE(<Col_Name>))>0

    THEN RTRIM(SUBSTRING(<Col_Name>,1,LEN(<Col_Name>)-(PATINDEX('%[0-9]%',REVERSE(<Col_Name>)))-2)) -- Please note, we have considered 3 numeric digits in this case

    ELSE...

Viewing post 1 (of 1 total)