Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2003
    Posts
    15

    Angry Unanswered: Trim the middle os a string...

    Hi ya!


    I have a string that looks like: 01/01/NA/00008301/PRM/Communic I want only the "00008301" part of the string, how can I get this through an sql statment?

    Function???

    Thanks,

    Ken

  2. #2
    Join Date
    Dec 2001
    Location
    Toronto, Canada
    Posts
    335
    You can use SUBSTRING
    Code:
    set nocount on
    go
    declare @c varchar(30)
    
    set @c= '01/01/NA/00008301/PRM/Communic'
    
    select substring(@c,10,8)
    Output
    Code:
    -------- 
    00008301
    MCDBA

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •