Named Query Script to Add Column Values from a DB Table with Null Rows

There was an example of the GROUP BY in my original post.

SELECT Reason, SUM([DTMIN])
FROM vwIG_DownTimeDetailsByPID
WHERE Reason = 'Electrical'
  AND (
    ([Trans Date] BETWEEN '2024-01-02'AND '2024-01-09')
    OR ([Trans Date] BETWEEN '2024-01-02' AND '2024-01-09')
    OR ([Trans Date] <= '2024-01-02' AND [Trans Date] >= '2024-01-09')
  )
GROUP BY Reason

See also, Wiki - how to post code on this forum