Skip to content

SQL Scripts–Order Count–YTD By User

September 6, 2011

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

About these ads

From → Dynamics GP, RLDU, SQL

4 Comments
  1. 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.

  2. 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.

Trackbacks & Pingbacks

  1. Everything Dynamics GP #27 - About Dynamics, Development and Life - GP Technical Blogs - Microsoft Dynamics Community
  2. SQL Scripts–Order Count–YTD By User « Real Life Dynamics User - DynamicAccounting.net - GP Technical Blogs - Microsoft Dynamics Community

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 27 other followers

%d bloggers like this: