convert the chat to date time - error

Results 1 to 2 of 2

Thread: convert the chat to date time - error

  1. #1
    Join Date
    Dec 1969
    Posts
    234

    Default convert the chat to date time - error

    Hi below is my code to update all the records where fee is null. <BR>--------------------------------------------------------<BR><BR>Set rs = Server.CreateObject("ADODB.Recordset")<BR><BR>sql = "SELECT Appl_ref_num, Fee_rec_num, applrefnum, invoice_date, invoice_num FROM testTable1, testTable2 WHERE testTable1.Appl_ref_num = testTable2.applrefnum "<BR><BR>rs.Open sql, cn<BR>Response.Write sql<BR>do until rs.eof<BR> Applnumber = trim(rs("ApplrefNum"))<BR> feerecnum = trim(rs("invoice_num"))<BR> ReceivedDate = rs("invoice_date")<BR> <BR> If trim(rs("fee_rec_num")) = "" then<BR> <BR> Set objData = CreateObject("ADODB.Connection")<BR> objData.Open cn<BR> <BR> strSQL = "UPDATE testTable1 SET fee_rec_num = &#039;" & feerecnum & "&#039;, fee_rec_date = &#039;" & ReceivedDate & "&#039; where Appl_ref_num = &#039;" & Applnumber & "&#039; " <BR><BR> Response.Write strSQL <BR> objData.Execute strSQL<BR> Else<BR> Response.Write "No Records found"<BR> Response.End<BR> <BR> End if<BR><BR>rs.movenext<BR>loop<BR>-------------------------------------------------<BR><BR>when i run the asp i am getting this error. <BR><BR>-----------------------------------------------------------<BR>Microsoft OLE DB Provider for ODBC Drivers error &#039;80040e07&#039; <BR><BR>[Microsoft][ODBC SQL Server Driver][SQL Server]The conversion of char data type to smalldatetime data type resulted in an out-of-range smalldatetime value. <BR>--------------------------------------------------------------<BR><BR>but i am using smalldatetime in both tables and no char data type. any ideas ?<BR><BR>Thanks in advance

  2. #2
    Join Date
    Dec 1969
    Posts
    19,082

    Default RE: convert the chat to date time - error

    is that error on the first query or the second?<BR><BR>and did you know you don&#039;t have to mess about with ASP for this, it can be done in pure SQL much more easily?<BR><BR><BR>j<BR>http://rtfm.atrax.co.uk/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •