les consulto, lo siguiente, tengo una hoja con un refresh cada 1 minuto...y realiza las siguientes consultas...
Código PHP:
$query = "SELECT COUNT(eventid) FROM events WHERE eventtypendx = '14' AND DATEDIFF(day, eventtime, getdate()) < 1 AND devicename LIKE '%inq%'";
$result = mssql_query($query);
$count = mssql_fetch_array($result);
$query = "SELECT COUNT(eventid) FROM events WHERE eventtypendx = '14' AND DATEDIFF(day, eventtime, getdate()) < 1 AND devicename LIKE '%SAL%'";
$result = mssql_query($query);
$count1 = mssql_fetch_array($result);
$inq = $count[0] - $count1[0];
$query = "SELECT COUNT(eventid) FROM events WHERE eventtypendx = '14' AND DATEDIFF(day, eventtime, getdate()) < 1 AND devicename LIKE '%PB1%'";
$result = mssql_query($query);
$count = mssql_fetch_array($result);
$query = "SELECT COUNT(eventid) FROM events WHERE eventtypendx = '14' AND DATEDIFF(day, eventtime, getdate()) < 1 AND devicename LIKE '%SS1%'";
$result = mssql_query($query);
$count1 = mssql_fetch_array($result);
$garage = $count[0] - $count1[0];
Se podría de alguna manera hacer q esta consulta se ejecute de forma mas rapida? Hoy tarda unos 15..20 seg. en mostrar los resultados
gracias a todos!