Re: SUBSTRING question
From: Anith Sen (anith_at_bizdatasolutions.com)
Date: 09/27/04
- Next message: Anith Sen: "Re: Number to Date"
- Previous message: Miguel Salles: "Number to Date"
- In reply to: anonymous_at_discussions.microsoft.com: "Re: SUBSTRING question"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 27 Sep 2004 13:25:46 -0500
If all your values are of the same format, you can do:
SELECT LEFT( c, CHARINDEX( '-', c ) - 1 ) AS "before dash",
RIGHT( c, CHARINDEX( '\', REVERSE( c ) ) - 1 ) AS "after dash"
FROM tbl ;
-- where c is your column & tbl is your table
-- Anith
- Next message: Anith Sen: "Re: Number to Date"
- Previous message: Miguel Salles: "Number to Date"
- In reply to: anonymous_at_discussions.microsoft.com: "Re: SUBSTRING question"
- Messages sorted by: [ date ] [ thread ]