I want to create a function that gets the last record from my table, but it didn't work.
My code is :
CREATE FUNCTION GetLastReglement (@CT_Num VARCHAR(17))
RETURNS VARCHAR(17)
AS
BEGIN
SELECT TOP (1) *
FROM F_REGLEMENTT
WHERE CT_Num=@CT_Num
ORDER BY CT_Num DESC
RETURN @CT_Num
END
Thanks for your help
PS: I'm novice in SQL