Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Null value is eliminated by an aggregate or other SET operati

Status
Not open for further replies.

Azita79

Programmer
Jan 30, 2003
41
US
Hi All,

when I execute my sproc, passing a null value, I get this error:

Warning: Null value is eliminated by an aggregate or other SET operation.

here is the sproc

Create procedure dbo.Search
(@BeginDate DateTime,
@EndDate DateTime)
As

DECLARE @vBeginDate NVARCHAR(20)
DECLARE @vEndDate NVARCHAR(20)
DECLARE @vStrSQL NVARCHAR(2000)

IF @BeginDate IS NOT NULL OR @EndDate IS NOT NULL
BEGIN
IF @BeginDate IS NULL
SELECT @BeginDate = MIN(A.ApprecdDate)
FROM WQOnsite.dbo.tblApplication A

IF @EndDate IS NULL
SELECT @EndDate = MAX(A.ApprecdDate)
FROM WQOnsite.dbo.tblApplication A

SET @vBeginDate = convert(VARCHAR(12), @begindate, 102)
SET @vEndDate = convert(VARCHAR(12), @EndDate, 102)
SET @vstrsql = 'SELECT * FROM tblApplication A where a.appRecddate between ''' +
@vBeginDate + ''' and ''' + @vEndDate + ''''

END

exec (@vStrSQL)

***********************

(EXEC SEARCH '1/1/1992', NULL )gives me the right result but I get the above warnning and the same with begindate is being null.


Thank you for your help in advance
 
Thanks for the hint Terry, but still getting the same warning.

Any thoughts anyone???


Azita
 
Terry,

Now that I put it after the AS I don't get the warning message, but I'm still getting an error message when I execute it from the fortend(Access Unbound Form)

"The object you entered is not a valid RecordSet porperty"

I get the above error when either of the dates are NULL.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top