Say I have a list of dates in a table. Now I want to find all rows that are in the same week as the date provided as an argument.
Let's say I have a table with:
- 2014-09-11
- 2014-09-12
- 2014-09-15
And I pass this function to argument 2014-09-09, it should look from Monday to Sundays and understand that 09-11 and 09-12 are part of the week, but not 09-15.
How to solve this problem?
I thought about checking for a year, month, and week, but you cannot guarantee that the month is the same ...
So how do you solve such a problem?
source
share