我對tsql和ssrs很新,我只有3天的培訓,所以要溫柔! 我想寫一份報告,顯示訂單遲到的每個月的次數,並顯示我們準時到達的百分比。到目前爲止,我得到這個:tsql ssrs過期訂單的百分比
SELECT
COUNT(*) AS NoOfWo,
CASE WHEN DATEDIFF(d, CompletionDate, LastActualCompDate) <= 0 THEN 'OnTime' ELSE 'Late' END AS Performance,
DATENAME(mm, LastActualCompDate) AS month
FROM WipHeader
WHERE (LastActualCompDate >= CAST(DATEPART(year, GETDATE()) AS varchar) + '-01-01')
GROUP BY
CASE WHEN DATEDIFF(d, CompletionDate, LastActualCompDate) <= 0 THEN 'OnTime' ELSE 'Late' END, MONTH(LastActualCompDate), DATENAME(mm, LastActualCompDate)
ORDER BY
MONTH(LastActualCompDate)
這晚,在時間和訂單總數每月數今年迄今返回數字,但我不能工作,如何回報百分比是多少? 任何幫助將不勝感激! 謝謝。