Posted on: 8/13/2014 11:29:55 AM | Views : 405

Hi
I am looking for , to get dayname  from the following function. Please help to correct this function Also the folowing error is coming
Select statements included within a function cannot return data to a client.
  /****** Object:  UserDefinedFunction [dbo].[ufEmployeeHrs]    Script Date: 13/08/2014 16:21:37 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER FUNCTION [dbo].[ufEmployeeHrs](@Recordid int,@DateWorked date) RETURNS decimal(4,2)  AS  BEGIN     DECLARE @ret decimal(4,2) ; DECLARE @DateName Varchar; Strig dayname = SELECT datename(dw,convert(datetime, @DateWorked, 111));
If dayname='Monday' then
ret = select monhr from workhrs
Go to the complete details ...