DateTime.ParseExact adjustment

I have this condition set for a datetime that refers to one excel column with dates on it:

DateTime.ParseExact(row("columnname ").ToString.Substring(0, 10),“MM/dd/yyyy”, System.Globalization.CultureInfo.InvariantCulture) < Now.AddDays(-2)

I want to simply have the condition only recognize the previous two days, nothing more then that. When I run it it’ll also affect days that are more then 2 days. Does anyone know what I would need to do to only have the last two days recognized and not everyday previous to today?

2 Likes

@ArvSeyZar
have a check on this interpretation

DateTime.ParseExact(row("columnname ").ToString.Substring(0, 10),“MM/dd/yyyy”, System.Globalization.CultureInfo.InvariantCulture) >= Now.AddDays(-2)

2 Likes

I’ve done that equation as well, unfortunately I still get the same issue. For example, I have dates in the column for 1/8/2020 and 1/7/2020, but the 1/7/2020 is still sent an email. I only want 1/8/2020 to be sent an email.

can you give some more details on your flow. E.g Descripton, Screenshot. Thanks

Here’s the main area I am focusing on in terms of the condition. Orientation stands for the dates that are listed on the excel sheet.

And here are the dates I have on the excel sheet. I only want to send the email to the 1/8/2020 row.
image

@ArvSeyZar
your date format in the screenshot is dd/MM/yyyy
you used in the statment MM/dd/yyyy instead

Please have a look on it and correct it if needed

then your row date should be >= today(-2) And row date should be <= today fitting into the last two days slot

2 Likes

Got it. Thank you so much for your help!