I want to pass my date parameters to my stored procedure.
Because MS SQL uses format like 'YYYY-DD-MM', I want to convert cf_SQL_Date to the reight format to pass CFQUERY. I need include single quote.
I have following code, it seems that it does not work.
Your help and information is great appreciated,
<CFIF NOT isdefined("StartDate")>
<CFSET form.StartDate = #DateFormat(NOW() - 20 , "'yyyy-mm-dd'")#>
</CFIF>
<CFIF NOT isdefined("EndtDate")>
<CFSET form.EndDate = #DateFormat(NOW(), "'yyyy-mm-dd'")#>
</CFIF>
<cfquery name = "mydata" datasource = "MyDSN">
execute MySP #form.StartDate#, #form.EndDate#
</cfquery>
Regards,
Iccsi,