Go4Expert (http://www.go4expert.com/)
-   Database (http://www.go4expert.com/forums/database-forum/)
-   -   error when qerying to mysql from an asp page (http://www.go4expert.com/forums/error-qerying-mysql-asp-page-t23954/)

franrtorres77 22Nov2010 03:41

error when qerying to mysql from an asp page

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_numRows = 0

Best regards and thank you.

franrtorres77 15Jan2011 18:19

Re: Greetings?!?!

Originally Posted by invoftfog (Post 77556)

I have already solved it.

All times are GMT +5.5. The time now is 19:03.