Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error on date entry.

Status
Not open for further replies.

grnzbra

Programmer
Mar 12, 2002
1,273
US
I have an asp page calling a SQL Server stored Procedure to update a table. The field in the stored procedure is a datetime field.

The asp page code is:

Error converting date type char to int.

Set cmdUpdateZIPCode = Server.CreateObject("ADODB.Command")
cmdUpdateZIPCode.ActiveConnection = connection string
cmdUpdateZipCode.CommandText = "StoredProcedure"
cmdUpdateZIPCode.CommandType = 4
cmdUpdateZipCode.CommandTimeout = 0
cmdUpdateZipCode.Parameters.Append cmdUpdateZipCode.CreateParameter("@date", adDBTime, adParamInput)


cmdUpdateZipCode.Parameters("@date") = CDate(Request.Form("txtDate"))

cmdUpdateZipCode.Execute

<html>
<head>
<title></title>
</head>
<body>
<form>


<!-- DATE EXPIRED -->
<td colspan=2 style='font-size: 12px; font-weight: bold; text-align: right;'>Date Expired</td>
<td colspan=3>
<input name='txtDate' value='<%= rsZIPCodes("ZIPDateExpired")%>'></td>

</form>
</body>
</html>

For all the other fields on the page, this works fine. However, if an entry is made into this date field I get the following error:

"Error converting date type char to int."

How can I get this thing to take a date?
 
OOPs. That first line
Error converting date type char to int.
shouldn't be there. It is not in the code. It is the error message I get when I run the code
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top