This is ma coding! wen i execute it pops up with a error
Msg 178, Level 15, State 1, Procedure sss, Line 27
A RETURN statement with a return value cannot be used in this context.


Plz HELP???!!!!

alter function dbo.sss( @mdvn int,@fdate date,@tdate date)
RETURNS @Tab TABLE
(
ifa int,
bp int,
hb int
)
AS
BEGIN
declare @ifa int,@bp int,@hb int;
declare pcurs CURSOR FOR
select @bp,@ifa,@hb from
(
select dvn_cd,phc_cd,hsc_cd,
case when IFA=100 and ANEDD between @fdate and @tdate then 1 else 0 end as ifa,
case when BP>='140/90' and ANEDD between @fdate and @tdate then 1 else 0 end as bp,
case when HB<11 and ANEDD between @fdate and @tdate then 1 else 0 end as hb
from ANVisits3 a where DVN_CD=@mdvn and ANEDD between @fdate and @tdate and ifa=@ifa and bp=@bp and hb=@hb
)a group by dvn_cd,phc_cd,hsc_cd
OPEN pcurs
BEGIN
fetch NEXT FROM pcurs INTO @ifa,@bp,@hb
WHILE @@Fetch_status = 0
BEGIN
select 'DVN:'+ convert(varchar(20),@mdvn)+ 'IFA:'+@ifa+ 'BP:' +@bp+ 'HB:' +@hb
fetch NEXT FROM pcurs INTO @ifa,@bp,@hb
Return @Tab
END
END
END
--close pcurs
--deallocate pcurs