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
createfunction NVL(@valor int, @Inicio int)
RETURNSintASSELECTCASEWHEN @Valor ISNULLAND @Inicio ISNULLTHENNULLWHEN @Valor ISNULLAND @Inicio ISNOTNULLTHEN @Inicio
WHEN @Valor ISNOTNULLTHEN @Valor
END