That's the problem i execute the query and it returns a value but the function returns null.
>You'll get null if there're no records matching query conditions.
>
>>I ´ve designed this function in sql server but it returns null instead of the correct value, i execute the sql query and i see the correct value.
>>
>>Any Idea what is wrong.
>>
>>
>
>>ALTER FUNCTION dbo.TotVenci
>> (@IdCliente Int,
>> @hasta datetime )
>>RETURNS money
>>AS
>> BEGIN
>> Declare @totvenci money
>> set @totvenci=(select sum(venci.importe) from venci where
>> venci.IdCliente=@IdCliente and venci.fecha<=@hasta )
>> RETURN @totvenci
>> END
>