Doesn't work for me, presumably because the date format is different (caused by use of STRING to manipulate date components?), though I'm not up to verifying that at the moment.
FUNCTION lastDay RETURNS DATE (INPUT dDate AS DATE):
IF dDate EQ ? THEN RETURN ?.
IF month(dDate) = 12 THEN RETURN DATE(12,31,YEAR(dDate)).
RETURN DATE(MONTH(dDate) + 1,1,YEAR(dDate)) - 1.
END FUNCTION.
MESSAGE lastDay(date(01,01,2008)).
What I'm using is:
Function MonthEnd Returns Date ( Input inDate As Date):
Return ((Date(Month(inDate),28,Year(inDate)) + 4) - Day(Date(Month(inDate),28,Year(inDate)) + 4)).
End.
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.