السلام عليكم ورحمته الله وبركاته
ما الخطا فى هذه الfunction
CREATE FUNCTION amountemp (@id int) -- Add the parameters for the function here RETURNS decimal(5, 3) AS BEGIN -- Declare the return variable here DECLARE @total1 decimal(5, 3) DECLARE @date datetime -- Add the T-SQL statements to compute the return value here SET @total1= SELECT a.total1 FROM amount a WHERE a.emp_id=@id AND a.date1=@date
حيث اقوم باستعراض total1 من الجدول واظهارة فى متغير فقط
وشكراااااااااااا
يظهر هذا الerror
Incorrect syntax near the keyword 'SELECT'.
