Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Function that works the same way as VFP NVL( )
Message
From
12/08/2004 16:03:48
Peter Wagner
Point Informática Ltda.
Limeira, Brazil
 
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Function that works the same way as VFP NVL( )
Miscellaneous
Thread ID:
00932917
Message ID:
00932917
Views:
66
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 
Next
Reply
Map
View

Click here to load this message in the networking platform