hiii, i am executing the following stored procedure but having errors...
create procedure check_returns @salesman varchar(10),@RCV10 int,@RCV09 int,@RCV15 int,@GPRS15 int,@RCV20 int,@RCV25FTT int,@RCV25 int,@RCV31 int,@RCV30 int,@RCV35 int,@RCV50 int,@RCV55 int,@SIM int,@VTOPSIM int,@VTOPBAL int,@THREEGSIM int, @ENTRYDATE datetime
AS
BEGIN
if exists(select * from CardsIssued where salesman=@salesman and RCV10>@RCV10 AND RCV09>@RCV09 AND RCV15>@RCV15 AND GPRS15>@GPRS15 AND RCV20>@RCV20 AND RCV25FTT>@RCV25FTT AND RCV25>@RCV25 AND RCV31>@RCV31 AND RCV30>@RCV30 AND RCV35>@RCV35 AND RCV50>@RCV50 AND RCV55>@RCV55 AND SIM>@SIM AND VtopSim>@VTOPSIM AND VtopBal>@VTOPBAL AND ThreeGSim>@THREEGSIM and EntryDate=@ENTRYDATE )
BEGIN
insert Cards_Sold values(@salesman,@RCV10,@RCV09,@RCV15,@GPRS15,@RCV20,@RCV25FTT,@RCV25,@RCV31,@RCV30,@RCV35,@RCV50,@RCV55,@SIM,@VTOPSIM,@VTOPBAL,@THREEGSIM,@EntryDate)
END
ELSE
PRINT'CARDS RETURNED CANNOT BE GREATER THAN CARDS ISSUED'
END
the error coming is....
Msg 8114, Level 16, State 5, Procedure check_returns, Line 0
Error converting data type varchar to datetime.


plz let me know the exact changes and the line no. where to place the changes

Hello sukriti, just a bit of advice as you are new here.

If you could please seperate your comments and your code by using the code button supplied in the forum post editor, this will allow people to more quickly identify the issue instead of trying to seperate code from text.

Secondly, we need a bit more information about the issue, what sort of Database is it to begin with and what is the error, what where you expecting to happen and what happened?

hii, thanks for the advice.
i have 3 tables

Cardsissue
Cards_Return
Cards_Sold
what i am trying to do is to restrict accept Cards_return values if it is less than CardsIssue as per the salesman and Entrydate.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.