dDateDate in the week; default Date().
AdvPL GuideLastDayWeek([dDate]) -> dFridayCalculates the Friday associated with a date’s week.
The documented result is Friday; holidays are ignored. For Saturday it returns the previous day. It is therefore not a complete financial calendar despite the description’s last-business-day wording. Requires LIB 20210517 or newer and a TLPP-capable binary. (Sources: refs. 1–1.)
LastDayWeek([dDate]) -> dFridaydDateDate in the week; default Date().
Calculated Friday date.
#Include "Protheus.ch"
User Function Ed503()
Local dFriday := LastDayWeek(SToD("20261031"))
// Test Saturday; holidays are not considered.
ConOut(DToS(dFriday))
Return NilExpected result: 20261030. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.
© 2026 Usina.BR. All rights reserved. TOTVS, Protheus, Microsiga and their respective logos are trademarks of their owners. AdvPL Guide is independent and uses limited, attributed excerpts justified by educational purposes. See the Terms of Use. Terms of Use
Comments
There are no approved comments yet.
Sign in with Google or Microsoft to comment.