SELECT COUNT(*) AS Expr1, evtDate, Products.ProdExtId
FROM Events INNER JOIN
Items ON Events.EvtItemId = Items.ItmIntId INNER JOIN
EventTypes ON Events.EvtTypeId = EventTypes.EvtTypeIntId INNER JOIN
TouchPoints ON Events.TouchPointId = TouchPoints.TPtIntId AND EventTypes.EvtTypeIntId = TouchPoints.TPtEvtTypeId INNER JOIN
Products ON Items.ItmProdId = Products.ProdIntId
WHERE (Events.EvtTime > @Param3) AND (Events.EvtTime < @Param4) AND (TouchPoints.TPtExtId <> 'plant' AND TouchPoints.TPtExtId <> 'storage')
GROUP BY evtDate, Products.ProdExtId
ORDER BY evtDate, Products.ProdExtId
ASKER
Microsoft SQL Server is a suite of relational database management system (RDBMS) products providing multi-user database access functionality.SQL Server is available in multiple versions, typically identified by release year, and versions are subdivided into editions to distinguish between product functionality. Component services include integration (SSIS), reporting (SSRS), analysis (SSAS), data quality, master data, T-SQL and performance tuning.
TRUSTED BY
Open in new window