Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8950

Re: Compare sales by date

$
0
0

Hi,

 

Try this invoice only query first.

 

SELECT P.CardCode 'Customer#', P.CardName,[2011],  [2012],  [2013] FROM  (SELECT T0.CardCode, T0.CardName,T0.DocTotal as [Total],Year(T0.DocDate) as [year]   FROM OINV T0) S    PIVOT  (SUM(S.[Total]) FOR [year] IN ([2011],[2012],[2013])) P

 

Thanks,

Gordon


Viewing all articles
Browse latest Browse all 8950

Trending Articles