CREATE FUNCTION [dbo].[GLAS_AGING] ( @tnum int, @flag VARCHAR(1)) RETURNs int as BEGIN declare @result int begin IF @flag = 'Y' AND @tnum > 999 set @result= 8
IF @tnum<=30 set @result= 0
IF @tnum <= 90 set @result=1
IF @tnum > 90 AND @tnum <= 180 set @result=2
IF @tnum > 180 AND @tnum <= 365 set @result= 3
IF @tnum > 365 AND @tnum <= 545 set @result= 4
IF @tnum > 545
set @result= 5
end
return @result
END
this is function how to invoke this function to crystal report in asp.net..... how to create in crystal report formula editor?