Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Group by time interval again
Message
From
31/01/2003 07:49:13
Anderson Girardi
Athenas Automação de Escritório
Porto Alegre, Brazil
 
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Group by time interval again
Miscellaneous
Thread ID:
00747602
Message ID:
00747602
Views:
47
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
Map
View

Click here to load this message in the networking platform