How do i check delivery date is within next 14 days or not..can anyone help me with this

I have a delivery date - 04/10/2021

I wanted to check this date is within next 14 days from current date.

Thanks for the help,
Divya

Is the Delivery date is coming from Excel? or just string variable ??

If its string variable you can check stringvariable < now.adddays(-14).tostring("MM/dd/yyyy)

@Divya_Kuchi
DateDiff is super usefull here!

DateDiff(dateinterval.Day,today(),cdate(checkDate)).ToString

1 Like

Could you please help me with how to check the date is on or before the current date?

Absolutely!

The key here is to look at the number returned by DateDiff

If the date we are checking is the same as the current date- DateDiff will return 0

If the date we are checking is before the current date- DateDiff will return a negative number

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