"Fehler beim konvertieren von Datentyp varchar in datetime"

Wie kann ich die lösen den Fehler in der folgenden Prozedur?

CREATE PROCEDURE cards
@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_Returned
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

Ausführen als:

execute cards 'S001',50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,'28/1/2013'

gibt die folgende Fehlermeldung:

Msg 8114, Level 16, State 5, Procedure cards, Line 0
Error converting data type varchar to datetime
  • Beim posten von code bitte markieren Sie es und trifft die {} - Taste, um es lesbar und schalten Sie das syntax-highlighting.
InformationsquelleAutor user1994734 | 2013-01-31
Schreibe einen Kommentar