Number of Proformas by Batch
SELECT
phbatch AS 'Batch No.',
bop AS Operator,
min(phindex) AS 'First Proforma',
max(phindex) AS 'Last Proforma',
count(phindex) AS '# of Proformas'
FROM prohead
INNER JOIN batch ON phbatch = bbatch
WHERE bper = '1209'
GROUP BY phbatch,bop
phbatch AS 'Batch No.',
bop AS Operator,
min(phindex) AS 'First Proforma',
max(phindex) AS 'Last Proforma',
count(phindex) AS '# of Proformas'
FROM prohead
INNER JOIN batch ON phbatch = bbatch
WHERE bper = '1209'
GROUP BY phbatch,bop
Number of Proformas by Timekeeper
SELECT tkloc AS 'Location', phbatch AS 'Batch No.', tkinit AS 'Tk #', tklast AS 'Last Name', MIN(phindex) AS 'First Proforma', MAX(phindex) AS 'Last Proforma', COUNT(phindex) AS '# of Proformas' FROM matter INNER JOIN prohead ON phmatter = mmatter INNER JOIN timekeep ON tkinit = mbillaty INNER JOIN batch ON phbatch = bbatch WHERE bper = '1209' GROUP BY tkloc,phbatch,tkinit,tklast ORDER BY phbatch,tkloc,tkinit
No comments:
Post a Comment