Handi Tjioe
Handi Tjioe

Reputation: 1

how to validate 2 dates (cannot be different months)

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.

Upvotes: -1

Views: 43

Answers (1)

Gustav
Gustav

Reputation: 55806

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

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

Upvotes: 0

Related Questions