Darshan、MySQL側でビューを作成して、上のコードのFROMステートメントにビューを追加しました。これは私に正しい出力を与えました。ありがとう。
<!--- Create the Manager Monthly Accruals (Mgt) dataset --->
<cfquery name="rsLeaveTimeManagerAccruals" datasource="care">
SELECT username, status, active, email, hiredate, tblUsers.picture AS eP
, TIMESTAMPDIFF(YEAR, hiredate, NOW()) AS year_passed
, TIMESTAMPDIFF(MONTH, hiredate, NOW()) MOD 12 AS month_passed
, TIMESTAMPDIFF(DAY, hiredate, NOW()) MOD 365 AS day_passed
, CONCAT(TIMESTAMPDIFF(YEAR, hiredate, NOW())," years, ",TIMESTAMPDIFF(MONTH, hiredate, NOW()) MOD 12," months, ",TIMESTAMPDIFF(DAY, hiredate, NOW()) MOD 365," days") AS EmployLengthActive
, TIMESTAMPDIFF(YEAR, hiredate, NOW()) AS monthly_accrual_time
, CASE WHEN FLOOR(DATEDIFF(NOW(), hiredate)/365) < 1
THEN '0'
WHEN FLOOR(DATEDIFF(NOW(), hiredate)/365) <= 5
THEN '14'
WHEN FLOOR(DATEDIFF(NOW(), hiredate)/365) >= 6
THEN '18'
END AS Management_Accrual
FROM v_reports_to_mgt_list LEFT OUTER JOIN tblusers ON tblusers.ID = v_reports_to_mgt_list.id
WHERE clr_accrual = '1' AND hiredate IS NOT NULL
ORDER BY hiredate
</cfquery>
「インターバル5年」を「インターバル1年」に変更します。 – Barmar