SQL Scripts–Order Count–YTD By User
Following up on my last script, SQL Scripts–Order Count–Previous Week By User, this script will show you the number of orders entered by user for the current year.
***Note that you will need to make sure the @doc_date is set to January 1st of the current year***
This script uses the following views:
– Historical Sales Documents (tspvSalesDocuementHistory)
DECLARE @doc_date DATETIME
–Set @doc_date to January 1st of the current year–
SET @doc_date = ‘1/1/2010’
SELECT created_by,
[Orders_Entered] = COUNT(*)
FROM dbo.tspvSalesDocumentHistory
WHERE Doc_Date >= @doc_date
AND Sales_Doc_Type = ‘order’
GROUP BY Created_By
ORDER BY orders_entered desc
I’m very plased too uncover tnis page. I need to to thank you for ones time for this wonderful read!!
I definitely savored every part of it andd i also
have yoou book-marked to see new stuff on your blog.
Hi ther everyone, it’s my first pay a quick visit at this web
site,and paragraph is really fruitful foor me, kee up posting such content.