Quantcast
Channel: Adobe Community: Message List - ColdFusion
Viewing all articles
Browse latest Browse all 21760

CFSET DATEFORMAT

$
0
0

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,


Viewing all articles
Browse latest Browse all 21760

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>