You are here: Re: Function to return "remaining" of field after it finds a character in the field. « MsSQL Server « IT news, forums, messages
Re: Function to return "remaining" of field after it finds a character in the field.

Posted by Jorgen [DK/2600] on 02/20/07 13:28

Solutions was :

set ANSI_NULLS ON

set QUOTED_IDENTIFIER ON

GO

CREATE FUNCTION [sapserviceaccount].[UNTRUNK2] (@inp as varchar(100))

RETURNS varchar(20) AS

BEGIN

declare @out varchar(20);

if LEN(@inp) > 0

begin

set @out = right( @INP, (LEN(@INP)-CHARINDEX('@', @INP)))

end

else

begin

set @out = @inp;

end

return @out

END

"Jorgen [DK/2600]" <nyhedsgruppe_hejhej_@gmail.com> wrote in message
news:45daf1e7$0$90272$14726298@news.sunsite.dk...
> Hi,
>
> another problem I have is that have compounded fields in my sql table.
>
> Example
>
> product@customer
>
> I need a simple function to return "customer", so it should return the
> value
> after "@", unfortunate "@" will sometimes be character number 6, sometimes
> character number 7 etc.
>
> regards
> Jorgen
>
>
>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация