Hey.
There is a table Table (id, date1, date2). How to check if at least one day from the period from date1 to date2 is included in a given month (the year is also specified)?
Implying that Date1 is less than Date2:
Date1 lies in the interval <1 day of the next month, and Date2> = 1 of the specified month. Specificity will enroll from the used DBMS.
Update
Need to work with dates.
January 2014:
The first number of 2014/01/01 - transfer to date type.
Add 1 month get 1 day of the next month.
Further by the algorithm.
Source: https://ru.stackoverflow.com/questions/397577/
All Articles