Hi All,
I have a requirement to compare the two different months of the year and find the first month of the year.
Thanks,
Kamalnath S
Senior Automation Engineer
Hi All,
I have a requirement to compare the two different months of the year and find the first month of the year.
Thanks,
Kamalnath S
Senior Automation Engineer
solution will depend on the datatype of the months are given as input. Can you share with us?
The Datatype was DateTime
When both dates are of DateTime we can do:
Hi @Kamalnath
Try this:
Assign -> date1 = CDate("01/15/2024")
Assign -> date2 = CDate("03/10/2024")
Assign-> firstMonthOfYear = If(date1.Month = date2.Month, date1.Month, If(date1.Month < date2.Month, date1.Month, date2.Month))
date1
, date2
are of DataType System.DateTime. firstMonthOfYear
is of DataType System.Int32.
The above dates are just examples.
Hope it helps!!