我有這個查詢寫入Access數據庫。如何爲絕對數字的值包含此SQL子查詢?
queryText = "SELECT Technicians.ID, firstName, lastName, Technicians.[Zone],
COUNT(technicianAssignedId) AS JobsDone,
MAX(Faults.timeCompleted) AS LastJobTime,
MIN(Technicians.[Zone] - & faultZone &) AS Distance ' MIN has no use
FROM Technicians LEFT OUTER JOIN Faults ON
Technicians.ID = Faults.technicianAssignedID
WHERE Specialization = '" & specialization & "'
`AND Availability = 'available'
GROUP BY Technicians.ID, firstName, lastName, Availability,` Technicians.[Zone], Specialization
ORDER BY 7 DESC"
我這得到絕對值
SELECT CASE
WHEN value < 0 THEN value * -1
ELSE number *1 END
AS VALUE
FROM DB;
現在,隨着距離的別名列,最終可能,我需要使用(* 1)爲正爲負數,但我可以」弄清楚如何把它放在一起。
感謝所有幫助
爲什麼不使用ABS(值)函數? – JamieSee