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!

Problem passing date to a stored procedure 1

Status
Not open for further replies.

casperovjp

Programmer
Jun 30, 2002
18
FR
I have a problem passing a date parameter created using CreateODBCDate to a
stored procedure here is the code
<cfset yourDate = CreateODBCDate(&quot;#URL.month#/#URL.day#/#url.year#&quot;)>
<cfstoredproc datasource=&quot;workflowdblocal&quot; procedure=&quot;sp_retrieve_sked&quot;>
<cfprocresult name=&quot;sked&quot; resultset=&quot;1&quot;>
<cfprocparam type=&quot;In&quot;
cfsqltype=&quot;CF_SQL_INTEGER&quot;
dbvarname=&quot;provider_id&quot;
value=&quot;1&quot; null=&quot;No&quot;>
<cfprocparam type=&quot;In&quot;
cfsqltype=&quot;CF_SQL_DATE&quot;
dbvarname=&quot;seldate&quot;
value=&quot;#yourdate#&quot; null=&quot;No&quot;>
</cfstoredproc>
 
What is the error message that you are receiving?

And, just out of curiosity, see if using the CreateODBCDateTIME() function solves the problem.
 
[Microsoft][ODBC SQL Server Driver]Optional feature not implemented

This is the error that I am getting. CreateODBCDateTime doesn't work either.:-(
 
can you see the code of the stored proc? what format does it expect?

maybe it's expecting a date string like '2003-05-14' and not an ODBC date like {d '2003-05-14'} or whatever the format is

so instead of CF_SQL_DATE in the cfprocparam, it should be CF_SQL_CHAR

or maybe try CreateDate instead

rudy
 
The stored proc is expecting a smalldatetime datatype. I tried changing it to CF_SQL_CHAR but to no avail. Then the CreateDate still gave me a datatype conversion error.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top