If you use the Case function you can check for a value of 0 - which means not found - for example
select case Charindex(' ', BS.FirstName)
when 0 then BS.FirstName
else substring(BS.FirstName, 1 , charindex(' ',BS.FirstName)-1)
end
from tblreportcpresults BS
will give you the first name...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.