Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Function that works the same way as VFP NVL( )
Message
 
 
To
12/08/2004 16:03:48
Peter Wagner
Point Informática Ltda.
Limeira, Brazil
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
00932917
Message ID:
00932923
Views:
19
The T-SQL ISNULL() function works the same as VFP NVL().

>I need some help to create a function that works the same way as VFP NVL function but only for integer or numeric fields.
>I try it with integer fields and it doesnt work.
>Any idea how to do it ?
>
>TIA
>
>
>create function NVL(@valor int, @Inicio int)
>RETURNS int
>AS
>SELECT CASE
>	WHEN @Valor IS NULL AND @Inicio IS NULL THEN NULL
>	WHEN @Valor IS NULL AND @Inicio IS NOT NULL THEN @Inicio
>	WHEN @Valor IS NOT NULL THEN @Valor
>END
>
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform