I need to bring in a single line, the amount of business days in a single month and with a certain "weight". For example: 02/05/2017 (Tuesday) the weight is 1 (considers 1 day). Already for 06/05/2017 (Saturday) I need you to consider 0.34 day.
Logo, I need through the result of a single line to go "adding" the weight of each day that passed. I did this SQL below, which brings the weight of the day, but it does not bring the accumulated. Maybe someone has an idea to do this. Thanks!
select 1 AS FILIAL,
to_char(sysdate,'mm') AS mês,
to_char(sysdate,'yyyy') AS ANO,
--to_char(sysdate,'dd/mm/yyyy'),
CASE
WHEN to_char(sysdate,'d') IN (1) THEN 0
WHEN to_char(sysdate,'d') IN (7) THEN 0.34
WHEN to_char(sysdate,'d') IN (2,3,4,5,6) THEN 1
END AS QUANT_DIAS_PRODUCAO
from dual