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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Null Fields Check!

Author  Topic 

pizzojm
Starting Member

20 Posts

Posted - 2001-10-22 : 11:14:22
Hello,

I am trying to figure out warehouse space by customer from a financial table that one of our employees enters each month. If the user tries to select a month that has not already been entered I want the procedure to get a default value. Everything is working fine, except if the month has not been entered, the IF statement if not working. Take a look and let me know if with any solutions -- Thanks Much appreciated!

CODE AS FOLLOWS:

------------------

CREATE PROCEDURE spWarehouseReport

@customerID INT,
@warehouseSpace INT OUTPUT,
@xDate SMALLDATETIME

AS

SELECT @warehouseSpace=cubicFeetUsed FROM tblFinancial WHERE datePosted=@xDate AND customerID=@customerID

IF @warehouseSpace= ??? HERE IS THE PROBLEM!
BEGIN
SELECT @warehouseSpace=minGuarenteed FROM tblCustomers WHERE customerID=@customerID
END

------------------

   

- Advertisement -