Skip to Content

If statement for days betwen

Hi

I need to create a variable that will show Y if 2 dates (Eff Date:Posn Work Pattern and Eff End Date:Posn Work Pattern) fall within the range of 2 other dates (Start Date:Occupancy and End Date:Occupancy) If the dates do not fall within the range then I need the variable to return N.

The End dates can be blank so I need this considered in the solution.

I also need the variable to show this by Personal Reference:People. I have attached a file to show an example of the data and what I would like the variable to display. I look forward to your comments/suggestions. Many thanks Willworking-pattern-sap.png

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Aug 02, 2017 at 04:19 PM

    follow these steps.

    Create variables

    V End Date:Occupancy=If(IsNull([End Date:Occupancy])) Then [Start Date:Occupancy] Else [End Date:Occupancy]

    V Eff End Date:Posn Work Pattern=If(IsNull([Eff End Date:Posn Work Pattern])) Then [Start Date:Occupancy] Else [Eff End Date:Posn Work Pattern]

    Final Variable=If([Eff Date:Posn Work Pattern] Between ([Start Date:Occupancy];[V End Date:Occupancy]) And ([V Eff End Date:Posn Work Pattern] Between ([Start Date:Occupancy];[V Eff End Date:Posn Work Pattern]))) Then "Y" Else "N"

    Add comment
    10|10000 characters needed characters exceeded