error when qerying to mysql from an asp page

Discussion in 'Database' started by franrtorres77, Nov 21, 2010.

  1. franrtorres77

    franrtorres77 New Member

    Joined:
    Nov 14, 2010
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    0
    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 gesconsat.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.
     
  2. franrtorres77

    franrtorres77 New Member

    Joined:
    Nov 14, 2010
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    0
    Re: Greetings?!?!

    I have already solved it.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice