Search the GP Tables
Search by TABLE NAME
Search by FIELD NAME
These are our SOP scripts. All of our scripts for Dynamics GP can be found here
DynDeveloper.com

DynDeveloper.com

Table Edits Forum Articles
Table Edits 0 Table Edits 0 Table Edits 0
Sign Up Now!Log In
acabot 3/8/2019 10:33:22 AM

Not Getting Desired SQL Results

This SQL Query:

Select CUSTNMBR as 'Customer', Convert(numeric(10,2),sum(ORTRXAMT)) as 'Revenue' as 'Revenue', Format(DOCDATE,'MMM-yy') as 'Period' FROM [SIZE].[dbo].[RM20101] 
  WHERE CUSTNMBR ='ACFLOR220' AND DOCDATE between '2/1/2019' and '2/28/2019' AND RMDTYPAL=1  
  GROUP BY CUSTNMBR, DOCDATE

Produces this:

Customer Revenue Period
ACFLOR220      337.25 Feb-19
ACFLOR220      310.65 Feb-19

But I want it to produce this:

ACFLOR220       647.90 Feb-19

What should I do?

Version: GP 2013
Section: Dynamics GP, SQL for Beginners, SQL Scripts








Table Definition Quick Links
All Tables
SOP Tables
RM Tables
GL Tables
POP Tables
HR Tables
PM Tables
UPR Tables
IV Tables
Olympic Tables