4 Replies Latest reply: Apr 27, 2012 12:45 AM by BKBK RSS

    Fail to pass datetime value to store procedure

    Phinehas1234 Community Member

      Hi,

       

      I have a store procedure which will receive the date passmeter and I write it as following:

       

      <cfif IsDefined("form.yy")>

           <cfprocparam cfsqltype="CF_SQL_TIMESTAMP" value="#CreateDate(form.yy, form.mm, form.dd)#">

      <cfelse>

           <cfprocparam cfsqltype="CF_SQL_TIMESTAMP" value="null" null="yes">

      </cfif>

       

       

      When I did not input the day, it runs correctly.

      However, it returns me the error when I input the day:

      Conversion failed when converting datetime from character string.

       

      How can I solve the problem?