Date match with margins

Hello i have two get text acitvites that extract two differenet dates from different places.
Date1 its from a pdf and date2 its from a program.

I also have a if statement that checks this date

I want to perform that if Date2 its more than date1 then it goes true if not goes false. But also the date2 can have a margin of 7 days plus and minus.

Example Date2 its 02.01.2020 and Date1 its 01.01.2020 then it goes true
if Date2 its 01.01.2020 and Date1 its 05.01.2020 then it goes true
but if Date2 its 01.01.2020 and Date1 its 20.01.2020 then it goes false because its more than 7 days difference plus or minus.

How can i do this ?


Hi, this will give you a head start :point_down:

Hi @langsem,

Please consider the below scenario:
Date1: 01.01.2020
Date2: 01.02.2020

If Date2<Date1 or (Cdate(date1).Day-CDate(date2).Day<7 or CDate(date1).Day-CDate(date2).Day<-7) then proceed for true branch else false.

Thanks & Regards,
Anand Jaiswal

thanks !

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.