Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT
- B.GroupBy,
- COALESCE(SUM(A.AuditCount),0) AS AuditCount,
- COALESCE(SUM(A.AuditTimerCount),0) AS AuditTimerCount,
- COALESCE(AVG(A.AuditAvgTimer),0) AS AuditAvgTimer,
- COALESCE(SUM(A.AuditCNTCount),0) AS AuditCNTCount,
- COALESCE(SUM(A.AuditCNTTimerCount),0) AS AuditCNTTimerCount,
- COALESCE(AVG(A.AuditCNTAvgTimer),0) AS AuditCNTAvgTimer,
- COALESCE(SUM(A.AuditWTOCount),0) AS AuditWTOCount,
- COALESCE(SUM(A.AuditWTOTimerCount),0) AS AuditWTOTimerCount,
- COALESCE(AVG(A.AuditWTOAvgTimer),0) AS AuditWTOAvgTimer,
- COALESCE(SUM(A.AuditPassCount),0) AS AuditPassCount,
- COALESCE(SUM(A.AuditPassTimerCount),0) AS AuditPassTimerCount,
- COALESCE(AVG(A.AuditPassAvgTimer),0) AS AuditPassAvgTimer,
- COALESCE(SUM(A.AuditFailCount),0) AS AuditFailCount,
- COALESCE(SUM(A.AuditFailTimerCount),0) AS AuditFailTimerCount,
- COALESCE(AVG(A.AuditFailAvgTimer),0) AS AuditFailAvgTimer,
- COALESCE(SUM(A.QCCount),0) AS QCCount,
- COALESCE(SUM(A.QCTimerCount),0) AS QCTimerCount,
- COALESCE(AVG(A.QCAvgTimer), 0) AS QCAvgTimer,
- COALESCE(SUM(A.QCPassCount),0) AS QCPassCount,
- COALESCE(SUM(A.QCPassTimerCount),0) AS QCPassTimerCount,
- COALESCE(AVG(A.QCPassAvgTimer), 0) AS QCPassAvgTimer,
- COALESCE(SUM(A.QCFailCount),0) AS QCFailCount,
- COALESCE(SUM(A.QCFailTimerCount),0) AS QCFailTimerCount,
- COALESCE(AVG(A.QCFailAvgTimer), 0) AS QCFailAvgTimer,
- COALESCE(SUM(A.ReceiveCount),0) AS ReceiveCount,
- COALESCE(SUM(A.ReceiveTimerCount), 0) AS ReceiveTimerCount,
- COALESCE(AVG(A.ReceiveAvgTimer), 0) AS ReceiveAvgTimer,
- COALESCE(SUM(A.RepairCount),0) AS RepairCount,
- COALESCE(SUM(A.RepairJobEntryCount), 0) AS RepairJobEntryCount,
- COALESCE(SUM(A.RepairTimerCount),0) AS RepairTimerCount,
- COALESCE(AVG(A.RepairAvgTimer),0) AS RepairAvgTimer,
- COALESCE(SUM(A.RepairPassCount),0) AS RepairPassCount,
- COALESCE(SUM(A.RepairPassJobEntryCount), 0) AS RepairPassJobEntryCount,
- COALESCE(SUM(A.RepairPassTimerCount),0) AS RepairPassTimerCount,
- COALESCE(AVG(A.RepairPassAvgTimer),0) AS RepairPassAvgTimer,
- COALESCE(SUM(A.RepairCBFCount),0) AS RepairCBFCount,
- COALESCE(SUM(A.RepairCBFJobEntryCount), 0) AS RepairCBFJobEntryCount,
- COALESCE(SUM(A.RepairCBFTimerCount),0) AS RepairCBFTimerCount,
- COALESCE(AVG(A.RepairCBFAvgTimer),0) AS RepairCBFAvgTimer,
- COALESCE(SUM(A.RefurbishCount),0) AS RefurbishCount,
- COALESCE(SUM(A.RefurbishJobEntryCount),0) AS RefurbishJobEntryCount,
- COALESCE(SUM(A.RefurbishTimerCount),0) AS RefurbishTimerCount,
- COALESCE(AVG(A.RefurbishAvgTimer),0) AS RefurbishAvgTimer,
- COALESCE(SUM(A.TechCount),0) AS TechCount,
- COALESCE(SUM(A.TechJobEntryCount),0) AS TechJobEntryCount,
- COALESCE(SUM(A.TechTimerCount), 0) AS TechTimerCount,
- COALESCE(AVG(A.TechAvgTimer),0) AS TechAvgTimer
- FROM
- (
- SELECT
- A.EntryDate,
- CAST(1 AS INTEGER) AS GroupBy
- FROM
- DateTable AS A
- ) AS B
- INNER JOIN
- DatabaseReportQuery AS A
- ON A.EntryDate = B.EntryDate
- WHERE
- B.EntryDate BETWEEN @Param1 AND @Param2
- GROUP BY
- B.GroupBy
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement