3 Replies Latest reply on May 19, 2007 4:09 PM by Dan Bracuk

    upload into datetime

    JohnGree Level 1
      Hi i have an csv file which i have a date time column which i need to upload to mysql database column with is formatted as datetime

      the problem i have is the csv is formatting the date time as mm-dd-yyyy hh:mm:ss which will not upload

      i have tried uploaing via a http request, is there a way of changing the format in th csv or adding some cf code to change the format after the http request

      the http code i am using is

      <cfloop index="currRow" from="#form.startRow#" to="#form.dispRows#">
      <cfif IsDefined("form.ID_#currRow#")>
      <cfset ID = Evaluate("form.ID_" & currRow)>


      <cfquery name="INSERT" datasource="#application.ds#">
      UPDATE records
      SET Dateoh = '#form["DateofSM_#currRow#"]#'
      WHERE ID = #ID#
      </cfquery>


      <cfelse>
      <cfbreak>
      </cfif>
      </cfloop>