Results 1 to 1 of 1
  1. #1
    Join Date
    Nov 2010
    Posts
    9

    Unanswered: error when querying to database from an asp page

    Hello.

    I have the following query for knowing the stopped time of some trucks of the company, this query works well in "mysql query browser" but in an asp page it tells me the next error:

    Microsoft OLE DB Provider for ODBC Drivers error '80004005'

    [MySQL][ODBC 5.1 Driver][mysqld-5.1.33-community]Unknown system variable 'timediff'

    /gps/pos.asp, línea 62



    the code is this:
    <%
    Dim paradas
    Dim paradas_numRows

    Set paradas = Server.CreateObject("ADODB.Recordset")
    paradas.ActiveConnection = MM_trucks_STRING
    paradas.Source = "set @nexttime := "", @nextms := "", @diff := ""; select velocidad,movil,fecha, concat(fecha, replace(fecha, '.', ':')) as Time, if(@nexttime<>"", timediff(@nexttime, fecha), "") as tdiff, if(@nextms<>"", abs(@nextms-fecha), "") as msdiff, if(@nexttime<>"", concat(timediff(@nexttime, fecha), replace(abs(@nextms-fecha), '0.', ':')),"") as FinalDifference, (@nexttime:=fecha) as Next, (@nextms:=fecha) as NextMS from posiciones where velocidad=0 and movil = 1883 and fecha >(now() - interval 2 day)"
    paradas.CursorType = 0
    paradas.CursorLocation = 2
    paradas.LockType = 1
    paradas.Open()

    paradas_numRows = 0
    %>


    Best regards and thank you.
    Last edited by franrtorres77; 11-21-10 at 18:17.

Posting Permissions

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