kramerd1506
Technical User
Hello all, I have a small problem I hope you all can help with. It seems pretty simple, but the resources I can find online don't help .
I'm trying to create a stored procedure in SQL Server 2000 which takes one input parameter as a unique key and returns the max(date_field) associated with that key out of one table.
This is the create procedure text:
CREATE PROCEDURE
lawprod.EB_MAX_CHECK_DATE (
@employeeNumber varchar(20)
)
as
BEGIN
return
(
select max(CHECK_DATE)
from lawprod.PAYMASTR
where EMPLOYEE = @employeeNumber
)
END
GO
When I execute this procedure with a valid input parameter, I get this error:
Syntax error converting the varchar value '05/31/2005' to a column of data type int.
05/31/2005 is the correct response, but the procedure will not return it. However, if I run the procedure text in the query analyzer, it works fine. Can someone explain what's going on here? I'm not asking that anything be converted to int, just return the datetime as it is.
I'm trying to create a stored procedure in SQL Server 2000 which takes one input parameter as a unique key and returns the max(date_field) associated with that key out of one table.
This is the create procedure text:
CREATE PROCEDURE
lawprod.EB_MAX_CHECK_DATE (
@employeeNumber varchar(20)
)
as
BEGIN
return
(
select max(CHECK_DATE)
from lawprod.PAYMASTR
where EMPLOYEE = @employeeNumber
)
END
GO
When I execute this procedure with a valid input parameter, I get this error:
Syntax error converting the varchar value '05/31/2005' to a column of data type int.
05/31/2005 is the correct response, but the procedure will not return it. However, if I run the procedure text in the query analyzer, it works fine. Can someone explain what's going on here? I'm not asking that anything be converted to int, just return the datetime as it is.