unknown
3/28/2007 6:42:00 PM
Great. Uri, thanks.
Kind rgrds
Mr. Smith
"Uri Dimant" <urid@iscar.co.il> wrote in message
news:%2341aoeTcHHA.984@TK2MSFTNGP04.phx.gbl...
> Hi
> DECLARE @st VARCHAR(20)
>
> SET @st ='Hello world'
>
>
> SELECT LEFT(@st, CHARINDEX(' ', @st)-1),
> RIGHT(@st, CHARINDEX(' ', REVERSE(@st))-1)
>
>
>
>
>
> "Mr. Smith" <nospam@nospam.com> wrote in message
> news:em81mYTcHHA.1240@TK2MSFTNGP04.phx.gbl...
>> Hi
>> I use this forumla in Excel to extract the left part of a string until
>> first space.
>> =LEFT(A1;SEARCH(" ";A1))
>>
>> Is there any way to do the same in a SQL query as in
>>
>> SELECT LEFT(fullname;SEARCH(' ';fullname) -- Which does not work.....
>> FROM tblpersons
>>
>> Any hints appreciated.
>>
>> Kind Regrads
>> Mr. Smith
>>
>>
>
>