how to validate 2 dates (cannot be different months)

48 Views Asked by At
firstDate secondDate
2022-12-02 2023-01-02
.. ...

the second date of the month follows the first date of the month, so the month of the date is can't be different

result like this : | firstDate | secondDate | | --- | --- | | 2022-12-02 | 2023-12-02 | | | ... |

If any body knows the query please share.

1

There are 1 best solutions below

0
On

Compare the month and perhaps the day as well (pseudo code):

Month(firstDate) = Month(secondDate) and
Day(firstDate) = Day(secondDate)