Re: SUBSTRING question
anonymous_at_discussions.microsoft.com
Date: 09/27/04
- Next message: Miguel Salles: "Number to Date"
- Previous message: Anith Sen: "Re: Sequel query pulling up duplicate data"
- In reply to: Anith Sen: "Re: SUBSTRING question"
- Next in thread: Anith Sen: "Re: SUBSTRING question"
- Reply: Anith Sen: "Re: SUBSTRING question"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 27 Sep 2004 10:34:18 -0700
Here is an example of the data in the Machine_Name field.
9ISDH19Z910B-NA\aalatro
I'm trying to split this field into two new fields called
BeforeDash and AfterDash using update queries.
BeforeDash AfterDash
9ISDH19z910B- -NA\aalatro
I have been somewhat successful in doing this using the
Left, Substring and charindex functions but the dash is
showing up in the parsed data. The string lengths of the
BeforeDash and AfterDash fields are not constant so I'm
having problems using the substring functions to further
break down the two new fields.
What is the best way to parse out everything on either
side of a certain character, not a position, in a string
field in SQL?
For example, If I just wanted 'DH19z910B' from the
BeforeDash field or I just wanted 'aalatro' from the
AfterDash field.
Thanks Again!!!
>-----Original Message-----
>Can you post a couple of examples of your data & the
expected results? Most
>likely you can get it done using the RIGHT & CHARINDEX
functions.
>
>--
>Anith
>
>
>.
>
- Next message: Miguel Salles: "Number to Date"
- Previous message: Anith Sen: "Re: Sequel query pulling up duplicate data"
- In reply to: Anith Sen: "Re: SUBSTRING question"
- Next in thread: Anith Sen: "Re: SUBSTRING question"
- Reply: Anith Sen: "Re: SUBSTRING question"
- Messages sorted by: [ date ] [ thread ]