Home Forums SQL Server 2005 T-SQL (SS2K5) Stored procedure which has problem with the function return value RE: Stored procedure which has problem with the function return value

  • SubmitDay = (SELECT 1 WHERE xxxx.dtSubmitDate BETWEEN @AsOfBeginDate AND @AsOfEndDate),

    --SubmitDay = (SELECT 1 WHERE xxxx.dtSubmitDate BETWEEN 'Aug 17 2007 12:00AM' AND 'Aug 17 2007 11:59PM'),

    C these two lines.

    1-with the variables.

    2-with the direct dates.

    so if I use line 1 I am not geting the correct result.

    if I individually run the function where this variable is used.

    It gets the date.

    but in line 1 I am getting null value for submitday .

    I have checked the function in this way.

    DECLARE @AsOfBeginDatedatetime

    DECLARE @ParmAsOfDatedatetime

    set @ParmAsOfDate='09/01/2007'

    SET @AsOfBeginDate = dbo.uf_RptGetDayBeginDate(@ParmAsOfDate)--@ParmAsOfDate)

    Print @AsOfBeginDate.