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

Re: Fast Moving Items Querry Modification with Date

$
0
0

Try This

 

 

 

SELECT t0.itemcode,

       MAX(t0.Dscription) 'Item Name',

       COUNT(T0.ItemCode) 'No. of Transaction',

       t3.ItmsGrpNam,t1.DocDate

FROM   dbo.INV1 t0

       INNER JOIN dbo.OINV t1

            ON  t1.docentry = t0.docentry

       LEFT OUTER JOIN dbo.OITM t2

            ON  t0.ItemCode = t2.ItemCode

       LEFT OUTER JOIN dbo.OITB t3

            ON  t2.ItmsGrpCod = t3.ItmsGrpCod

WHERE  t1.DocType = 'I'

       AND t1.DocDate BETWEEN '2015-06-01 13:28:15' AND '2016-08-17 13:28:15'

       AND t1.CANCELED = 'N'

       AND t0.BaseType <> 14

GROUP BY

       t0.itemcode,

       t3.ItmsGrpNam,t1.DocDate

ORDER BY

       t0.ItemCode ASC

 

If it repeat on the same date let me know

 

Cheers!


Viewing all articles
Browse latest Browse all 3585

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>