Hi
I have been trying to create a view where I and list out OTI reason in one column and then a count of account managers that have had these OTIFS against there orders
So trying to get this look from the query as below
I currently have this query and the output thus far.
SELECT (dbrderHeader.udfSalesOrderOTIF) AS Count, dbrderHeader.OrderStatus, dbo.SalesRep.Name,
dbrderHeader.udfSalesOrderOTIF
FROM dbrderHeader INNER JOIN
dbo.SalesRep ON dbrderHeader.SalesRepID = dbo.SalesRep.SalesRepID
GROUP BY dbrderHeader.OrderStatus, dbo.SalesRep.Name, dbrderHeader.udfSalesOrderOTIF
HAVING (dbrderHeader.OrderStatus = 8) AND (NOT (COUNT(dbrderHeader.udfSalesOrderOTIF) IS NULL)) AND (NOT (dbrderHeader.udfSalesOrderOTIF IS NULL))
ORDER BY COUNT(dbrderHeader.udfSalesOrderOTIF)
Could someone point me in the right direction please
Thanks
I have been trying to create a view where I and list out OTI reason in one column and then a count of account managers that have had these OTIFS against there orders
So trying to get this look from the query as below
I currently have this query and the output thus far.
SELECT (dbrderHeader.udfSalesOrderOTIF) AS Count, dbrderHeader.OrderStatus, dbo.SalesRep.Name,
dbrderHeader.udfSalesOrderOTIF
FROM dbrderHeader INNER JOIN
dbo.SalesRep ON dbrderHeader.SalesRepID = dbo.SalesRep.SalesRepID
GROUP BY dbrderHeader.OrderStatus, dbo.SalesRep.Name, dbrderHeader.udfSalesOrderOTIF
HAVING (dbrderHeader.OrderStatus = 8) AND (NOT (COUNT(dbrderHeader.udfSalesOrderOTIF) IS NULL)) AND (NOT (dbrderHeader.udfSalesOrderOTIF IS NULL))
ORDER BY COUNT(dbrderHeader.udfSalesOrderOTIF)
Could someone point me in the right direction please
Thanks