Oracle Analytics Cloud and Server

Welcome to the Oracle Analytics Community: Please complete your User Profile and upload your Profile Picture

Add 2 working days to a date field

Received Response
41
Views
1
Comments

Summary

Add 2 working days to a date field

Content

Hi All,

I have an RTF template where i want to add 2 working days to a date field( assume that working days mean from Monday to Friday).

Any ideas how ?

XML Publisher version is : 4.5.0

Regards,

Alex

Answers

  • Thomas Dodds
    Thomas Dodds Rank 8 - Analytics Strategist

    Why not do it in the Query?

    Silly example from dual....

    select trunc(sysdate) , to_char(sysdate,'DY'),

    case

    when to_char(sysdate,'DY') IN ('THU','FRI') THEN trunc(sysdate) +4

    when to_char(sysdate,'DY') = 'SAT' THEN trunc(sysdate) +3

    else trunc(sysdate) +2 end two_bus_days

    from dual;

    ^ MON-WED is 'easy' ... THU gets a MON workdate ... FRI, SAT & SUN get TUE workdate