Quote:
datetime comparison is known. but how to manage dates with yyyyMM format
Directly, because it is yyyyMM (in this order), you can directly compare the 2 values.
DateTimes are stored in format yyyyMMDD, dropping the days do not change anything.
string dt1= "202104"
string dt2= "202106"
if (dt1 < dt2) {
}
The problem when you have as MMyyyy format.