Solved

How can I query MS DYNAMICS to view prior years sales

Posted on 2012-03-21
11
246 Views
Last Modified: 2012-04-13
I am trying to determine 2010&2011sales numbers. I would also like to see by type commercial or non commercial items with totals.
0
Comment
Question by:manelson05
  • 7
  • 4
11 Comments
 
LVL 18

Expert Comment

by:Victoria Yudin
ID: 37750607
Which Dynamics product are you using?
0
 

Author Comment

by:manelson05
ID: 37750648
Dynamics 10
Mfg, Finanicials and project actg
0
 

Author Comment

by:manelson05
ID: 37750793
Dynamics GP
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 18

Expert Comment

by:Victoria Yudin
ID: 37751847
There is no one answer to your question, as there are a lot of different ways to enter 'sales' data into GP.  Also 'commercial' and 'non-commercial' are not GP terms, so you would need to identify what determines this in your data to be able to segregate your results this way.  

All that said, I have a bunch of different views posted on my blog that may help you either get the data you are looking for or at the very least give you some starting points:

SOP (Sales Order Processing) views: http://victoriayudin.com/gp-reports/sop-sql-views/

If this is not what you're looking for, or you need some more help, can you please provide more detail as to which modules in GP you are using to record sales and what exactly you want to report on?
0
 

Author Comment

by:manelson05
ID: 37752392
I am trying to determine total sales for the years 2010 and 2011 based on SOPNUMBE that start with CM and MM. All commerical SOPNUMBE begin with CM and all MIL start with MM
0
 

Author Comment

by:manelson05
ID: 37752542
We are using SOP and Inventory. I am wanting to see total sales for the two years.
I looked in SQL and did discover the SOPNUMBE defining MIL and Commercial sales as MM and CM.

Does this help you at all?
0
 

Author Comment

by:manelson05
ID: 37752632
I am trying to come up with total sales dollars not quantities.
0
 

Author Comment

by:manelson05
ID: 37752671
Is it possible to use INVOICe for yearly totals to get the total dollars sold that year?
0
 
LVL 18

Expert Comment

by:Victoria Yudin
ID: 37752730
How about something like this:

select year(DOCDATE) Sale_Year, left(SOPNUMBE,2) Sale_Type,  
sum(SUBTOTAL) Sales_Amt
from SOP30200 
where VOIDSTTS = 0 and year(DOCDATE) in (2010,2011) 
and left(SOPNUMBE,2) in ('MM', 'CM')
group by year(DOCDATE), left(SOPNUMBE,2)

Open in new window

0
 
LVL 18

Accepted Solution

by:
Victoria Yudin earned 500 total points
ID: 37752752
PS - that is assuming that only invoices start with MM and CM.  If that is not the case, you can either restrict on invoices only by adding the following before the last line:
and SOPTYPE = 3

Open in new window


or you need to do something more complicated, for example if you want to subtract returns.  Let me know if that is the case and I will help with that code if you need.
0
 

Author Closing Comment

by:manelson05
ID: 37845105
Excellent, this proved to be very helpful.

Thank you very much!


Mark
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Dynamics CRM with IFD and Sharepoint 1 72
Problem to path 13 78
Query on Microsoft Dynamics CRM 2013 & SQL Server 2012 SP2 6 70
Export Activity Feed in Dynamics CRM 3 12
On Sep 22nd 2014 Microsoft released Update Rollup 1 for Microsoft Dynamics CRM 2013 Service Pack 1 and back in July Update Rollup 3 was released.  So we now have:   Update Rollup 1Update Rollup 2Update Rollup 3Service Pack 1Update Rollup 1 for S…
Having trouble getting your hands on Dynamics 365 Field Service or Project Service trial? Worry No More!!!
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question