Re: SUBSTRING question

From: Anith Sen (anith_at_bizdatasolutions.com)
Date: 09/27/04


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