How do I get the percentage using SQL?
619584Jan 25 2008 — edited Mar 26 2008This SQL statement displays all of the work orders that were entered for the week that the query was ran. How do I get the percentage of all of the work orders that were entered for the week compared to all of the work orders that are still open (not completed)? Thank you!
SELECT
count(evt_code)
FROM
r5events
WHERE
evt_jobtype in ('BRKD') and
evt_org = '5221' and
evt_mrc ='7100-5221' and
EVT_REPORTED between trunc(next_day(sysdate, 'SUNDAY')-6) AND trunc(next_day(sysdate, 'SUNDAY'))
evt_code is the work order number(s).
evt_jobtype is the type of work order.
evt_org is the organization.
evt_mrc is the department.
evt_reported is the date the work order was reported.