Date 1(String) : 03/12/20
Date 2(String) : 02/12/20
For the above case in IF condition getting correct output as Date 1 is greater.
If date 2 changed as 02/12/21 still getting output as Date 1 is greater. How to proceed?
The code should work even if month is changed as a greater month.
I tried and it worked for me
DT1 = “03/12/2020”
DT2 = “02/12/2021”
IF DateTime.ParseExact(DT1.ToString,“dd/MM/yyyy”,System.Globalization.CultureInfo.InvariantCulture)>Datetime.ParseExact(DT2.tostring,“dd/MM/yyyy”,System.Globalization.CultureInfo.InvariantCulture)