[Based on this article by Pinal Dave.](http://blog.sqlauthority.com/2013/04/07/sql-server-pass-one-stored-procedures-result-as-another-stored-procedures-parameter/)

Error: *Operand type clash: date is incompatible with int*

I am trying to build a process involving three stored procedures (which individually are called by other processes, thus eliminating the ability to combine them) the first of which returns a date, which is then used for the parameter on the next procedure, and the process repeats itself the third time (the returned value of the second procedure is used as the parameter for the third procedure).

The below code shows a simplified similar process, where one procedure should return a date, which will then be used by the next procedure:

```
CREATE TABLE Pass(
    ID SMALLINT IDENTITY(1,1),
    IDDate DATE
)

INSERT INTO Pass (IDDate)
VALUES (DATEADD(DD,-1,GETDATE()))
    , (GETDATE())
    , (DATEADD(DD,1,GETDATE()))

CREATE PROCEDURE s_One
AS
BEGIN
    DECLARE @date DATE
    SET @date = DATEADD(DD,1,GETDATE())
    RETURN @date  -- generates the error
END

CREATE PROCEDURE s_Two 
@date DATE
AS
BEGIN

    SELECT *
    FROM IDDate
    WHERE [IDDate] = @date

END

DECLARE @d DATE
EXEC @d = s_One
SELECT @d
EXEC s_Two @d

```

According to the linked article, in theory, the returned value should be able to be used as a parameter for the next procedure, though the error I'm seeing is an operand type clash with a date and int:

**Msg 206, Level 16, State 2, Procedure s\_One, Line 6
Operand type clash: date is incompatible with int**

**Final Change Necessary:**

```
CREATE PROCEDURE s_One
( @date DATE OUTPUT )
AS
BEGIN
    SELECT @date = DATEADD(DD,1,GETDATE())
END

DECLARE @d DATE
EXEC s_One @d OUTPUT
SELECT @d
EXEC s_Two @d

```