Skip to Content
0

If statement for days betwen

Aug 02, 2017 at 03:35 PM

23

avatar image

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

AMIT KUMAR
Aug 02, 2017 at 04:19 PM
0

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"

Share
10 |10000 characters needed characters left characters exceeded