General information
Forum:
Microsoft SQL Server
Title:
Group by time interval again
Hello Dear friends,
i have two tables with the folow structure,
Fluxo(idCostumer, idDoor, dateTime, quantity)
clientesPortas(idCustomer, idDoor, name)
I need to create a SQL Statement to Sum the field quantity group by each 15 minutes?
i´m trying to do this
SELECT CONVERT(char(5), (fluxo.dateTime),108) AS Time, clientesPortas.name, SUM(fluxo.quantity) quantity, FLUXO.dateTime
FROM CLIENTESPORTAS INNER JOIN FLUXO ON CLIENTESPORTAS.idDoor = FLUXO.idDoor
WHERE CLIENTESPORTAS.idCustomer = 1 AND
fluxo.dateTime > '1/1/2003' AND
fluxo.dateTime < '1/2/2003'
GROUP BY CONVERT(char(5), (fluxo.dateTime),108), clientesPortas.name, FLUXO.dateTime
ORDER BY time, clientesPortas.name
But the result hide some values.
Someone can help me?
Thanks
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only