Professional Web Applications Themes

Stripping data out of a field, slightly diffrent case this time - Microsoft SQL / MS SQL Server

Hi All I posed last night asking how to collect the last 5 charectors from a field and leave the rest, I have done that using info from you guys. Thank You However now that I have done that I have found that the cell not only have data infront of it I dont want it also has it behine it I have a field like this "blah blah blah X blah blah blah" The data that I want is always the 18 - 21 charectors, this gets rid of the data in front:- SELECT RIGHT(column, LEN(column) - 17) The ...

  1. #1

    Default Stripping data out of a field, slightly diffrent case this time

    Hi All

    I posed last night asking how to collect the last 5 charectors from a field
    and leave the rest, I have done that using info from you guys. Thank You
    However now that I have done that I have found that the cell not only have
    data infront of it I dont want it also has it behine it


    I have a field like this
    "blah blah blah X blah blah blah"

    The data that I want is always the 18 - 21 charectors, this gets rid of the
    data in front:-
    SELECT RIGHT(column, LEN(column) - 17)

    The data behind is not always there how can I ony get the data from
    possitions 18-21?


    Cheers

    Mark


    "Sh0t2bts" <com> wrote in message news:... 
    bring 


    Sh0t2bts Guest

  2. #2

    Default Re: Stripping data out of a field, slightly diffrent case this time

    Hi Mark,

    Use SUBSTRING(column,18,4)

    18 is the starting position and 4 is the number of characters to select.
    I said 4 because you said the text that you want is always between 18 and 21
    characters and that is 4 characters inclusive of 18th and 21st.

    Thanks,
    Ram Thiru
    --
    This posting is provided "AS IS" with no warranties, and confers no rights.
    Use of included script samples are subject to the terms specified at
    http://www.microsoft.com/info/cpyright.htm


    "Sh0t2bts" <com> wrote in message
    news:%phx.gbl... 
    field 
    the [/ref]
    Name:" 
    > bring 
    >
    >[/ref]


    Ram Guest

  3. #3

    Default Re: Stripping data out of a field, slightly diffrent case this time

    Thank you
    :o)


    "Sh0t2bts" <com> wrote in message
    news:%phx.gbl... 
    field 
    the [/ref]
    Name:" 
    > bring 
    >
    >[/ref]


    Sh0t2bts Guest

Similar Threads

  1. stripping last field of a carriage return
    By Michael J. Golini in forum PERL Beginners
    Replies: 11
    Last Post: December 8th, 07:08 PM
  2. Stripping Data Help Needed
    By Ralph Freshour in forum PHP Development
    Replies: 2
    Last Post: October 13th, 03:49 PM
  3. Formatting a time field to 24 hour time (Military time) in the Datagrid
    By David Hearn in forum ASP.NET Data Grid Control
    Replies: 1
    Last Post: September 10th, 02:50 PM
  4. how to extract data filtering by a DateTime field (depending sample period time) ?
    By herve maillard in forum Microsoft SQL / MS SQL Server
    Replies: 3
    Last Post: July 6th, 05:41 AM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139