Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Creating function
Message
De
08/02/2004 05:21:53
Larry Santos
Local Data System
Philippines
 
 
À
Tous
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Stored procedures, Triggers, UDFs
Titre:
Creating function
Divers
Thread ID:
00875246
Message ID:
00875246
Vues:
55
Hi,

i have code and is return zero, what do i miss to my code?

alter FUNCTION RET_xxx (@val varchar(20))
returns varchar
AS

begin
declare @ret varchar(20)
IF LEN(@val) = 1
set @ret= '0000'+@val
ELSE IF LEN(@val) = 2
set @ret= '000'+@val
ELSE IF LEN(@val) = 3
set @ret= '00'+@val
ELSE IF LEN(@val) >= 4
set @ret= '0'+@val
RETURN(@ret)
end

TIA
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform