Viewing post 1 (of 1 total)
Here is the K.I.S.S. Version...
SELECT *, CASE WHEN(CHARINDEX(' ',test)=0) THEN test ELSE LEFT(test,CHARINDEX(' ',test)) END FROM tablename
This should work for you.
March 29, 2011 at 8:08 am
#1304887