Calculate the Number of Invoices (TRx Types) for a Given Period
— Calculate the Number of Invoices (TRx Types) for a Given Period
— Variables below …
— Replace the soptype X with a 3 for an invoice and a 4 for a return
— Change the = ‘X’ to IN (‘3’, ‘4’) to include both invoices and returns
— Change the year(docdate) XXXX with the year
— Change the month(docdate) XX with the period designation
— Change the = ‘XXXX’ to IN (‘2015′,’2016’) to include multiple years
— Change the = ‘XX’ to IN (’01’, ’02’, ’03’) to include multiple months
select day(sop30200.docdate) [date] , count(sop30200.sopnumbe)[# of Invoices]
from sop30200
where sop30200.soptype = ‘X’ and year(sop30200.docdate) = ‘XXXX’ and month(sop30200.docdate) = ‘XX’
group by sop30200.docdate
order by sop30200.docdate asc


