Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
hong_ma
Starting Member
37 Posts |
Posted - 2006-01-18 : 16:41:19
|
I have an user defined function and stored procedure. I can get a correct value from the user defined function. after I pass the value which from user defined function to a stroed procedure. I couldn't get a correct value from the stored procefure. it looks like dbo.adReporting.DateDue BETWEEN dbo.udfFYEDate(DateDue, dueday, ContactFYE) AND DateDue ) doesn't return a correct time period, but dbo.udfFYEDate(DateDue, dueday, ContactFYE) returns a correct value.CREATE FUNCTION dbo.udfDisplayTime ( @dueday int, @FrequencyID int, @ContactFYE smalldatetime) RETURNS smalldatetime AS BEGIN DECLARE @ReturnString AS smalldatetime Declare @dueday1 as int if (@FrequencyID =1) BEGIN set @dueday1 = @dueday -60 end select @ReturnString = DATEADD ( dd, @dueday1, @ContactFYE) Return @ReturnString END CREATE PROCEDURE dbo.asp_Reporting () AS SELECT * from join tables where (dbo.adReporting.DateDue BETWEEN dbo.udfFYEDate(DateDue, dueday, ContactFYE) AND DateDue ) |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
hong_ma
Starting Member
37 Posts |
Posted - 2006-01-19 : 21:42:10
|
Thanks a lot. Do you think the problem is from "Between" |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-01-20 : 01:09:21
|
Yes I think soMadhivananFailing to plan is Planning to fail |
|
|
|
|
|