In one of my coldfusion page that receives a charge number and updates the database, the codes looks like this:
<CFSET Expiration = '09/31/2003'>
<CFQUERY NAME="qryInsPayment" DBNAME="#Application.DSN3#"
DBTYPE="ODBC" DATASOURCE="#Application.DSN3#">
INSERT INTO dbo.PaymentMethod
(Charge_Number,
Expiration_Date,
PaymentID)
VALUES ('#ChargeNo#',
'#DateFormat(Expiration,"mm/dd/yyyy"
#',
'1')"
</CFQUERY>
and I don't know what's wrong with the date but it keeps giving me this error:
An error occurred while evaluating the expression:
#DateFormat(Expiration,"mm/dd/yyyy"
#
Error near line 208, column 17.
Parameter 1 of function DateFormat which is now "09/31/2003" must be a date/time value
ODBC Error Code = 22008 (Datetime field overflow)
[Microsoft][ODBC SQL Server Driver][SQL Server]The conversion of char data type to smalldatetime data type resulted in an out-of-range smalldatetime value.
SQL = "INSERT INTO dbo.PaymentMethod ( Charge_Number, Expiration_Date, PaymentID ) VALUES ( '6117 3753 2881 4352', '09/31/2003'), '1' )"
The error occurred while processing an element with a general identifier of (#DateFormat(Expiration,"mm/dd/yyyy"
#), occupying document position (208:16) to (208:52) in the template file c:\inetpub\
The date look right to me. Can someone help?
<CFSET Expiration = '09/31/2003'>
<CFQUERY NAME="qryInsPayment" DBNAME="#Application.DSN3#"
DBTYPE="ODBC" DATASOURCE="#Application.DSN3#">
INSERT INTO dbo.PaymentMethod
(Charge_Number,
Expiration_Date,
PaymentID)
VALUES ('#ChargeNo#',
'#DateFormat(Expiration,"mm/dd/yyyy"
'1')"
</CFQUERY>
and I don't know what's wrong with the date but it keeps giving me this error:
An error occurred while evaluating the expression:
#DateFormat(Expiration,"mm/dd/yyyy"
Error near line 208, column 17.
Parameter 1 of function DateFormat which is now "09/31/2003" must be a date/time value
ODBC Error Code = 22008 (Datetime field overflow)
[Microsoft][ODBC SQL Server Driver][SQL Server]The conversion of char data type to smalldatetime data type resulted in an out-of-range smalldatetime value.
SQL = "INSERT INTO dbo.PaymentMethod ( Charge_Number, Expiration_Date, PaymentID ) VALUES ( '6117 3753 2881 4352', '09/31/2003'), '1' )"
The error occurred while processing an element with a general identifier of (#DateFormat(Expiration,"mm/dd/yyyy"
The date look right to me. Can someone help?