can you tell me why it’s going into the else part if my date is less than the condition date. see what on the right side result tab.
Hey @balkishan,
For date comparison use Datetime.compare
Less than zero : If t1 is earlier than t2.
Zero : If t1 is the same as t2.
Greater than zero : If t1 is later than t2.
string
Convert it to datetime and use datetime.comapre method
sorry didn’t get bro
So, you need to convert it to the format date first and then try using compare class as @amarasto said in the earlier post.
Or the second option is give the date within the strings and then try.
Credits to : @amarasto
this JoiningDate is a string type variable. which extract the value from the doc. and I just compare it with the given condition. can you please tell me how to convert it to datetime.comare…
Datetime.compare(Convert.ToDateTime(JoiningDate),Convert.ToDateTime(“25/12/2019”))
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.