if day(currentdate) <= 28 then
(
if month(currentdate) <= 6 then
date(year(currentdate),month(currentdate)+6, day(currentdate)) else
if month(currentdate) > 6 then
date(year(currentdate)+1, month(currentdate)-6, day(currentdate))
) else
if day(currentdate) >= 29 then
(
if month(currentdate) <= 6 then
date(year(currentdate),month(currentdate)+7, 01)-1 else
if month(currentdate) > 6 then
date(year(currentdate)+1, month(currentdate)-5, 01) -1
)
This would default to the last day of the month if the day of the month was >= 29. Not perfect, but maybe close enough?
There might be another way I haven't thought of.
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.