i want my function to return a A table with some values
I must fix something in the update but i don\'t know what this is the function FngetTableH BELOW
Use top to select 1 record. May be it will solve your error.
select Distinct 0 , IdValeur
From Historique
Update @Listeab_
Set CLOSING_PRICE = (Select Top 1 CLOSING_PRICE
from Historique H
inner join (Select MAX(@Date) As DATEDU,IdValeur FROM Historique
where
DATE_NEGO<= @Date
group by IdValeur ) L2
on
H.DATE_NEGO=L2.DATEDU and H.IdValeur=L2.IdValeur
)