I am working in Oracle RightNow and I was using the below to calculate the Workdays between two dates but with the new year, the logic seems to no longer work. This would be the code used in a custom report column for a client.
((DATE_DIFF(sysdate(),incidents.created)/86400) + 1) - ((to_number(date_format(sysdate(),'WW')) - to_number(date_format(incidents.created,'WW')))* 2) - IF(Date_format(incidents.created,'DAY') = 'Sunday',1,0) - IF(Date_format(sysdate(),'DAY') = 'Saturday',1,0)
Is there different code I could use to accomplish this without it breaking with a new new year?
Thanks, B
You can use this Oracle answer:
Which, for the sample data:
Outputs:
db<>fiddle here
Looking at the Oracle RightNow CRM documentation, you can convert the Oracle solution to:
(Note: I do not have access to an Oracle RightNow environment so the conversion is untested and based solely on the documentation and there may be errors or possible improvements; however, it is hopefully sufficient to give you the solution.)