Thanks Karluk!
This is very short and elegant. I tried to build multiple if statement and temp variable to store the last date and manipulate the next_date to get the last sunday (or any other date), but you solve it using one line of code :-)
BTW, can we change the sunday into other day?
I am trying to build a query for finding the last day (eg. in this example I need to find the last Sunday of the month).
Anybody done it before / have example?
Thanks!
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.