Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
LPARAMETERS txDateValue
IF PCOUNT() = 0
RETURN DATE()
ENDIF
DO CASE
CASE VARTYPE(txDateValue) = "D"
RETURN txDateValue
CASE VARTYPE(txDateValue) = "C" && I am assuming date format "mm/dd/yyyy"
lnDay = CAST(GETWORDNUM(txDateValue, 1, "/") AS I)
lnMon = CAST(GETWORDNUM(txDateValue, 2, "/") AS I)
lnYr = CAST(GETWORDNUM(txDateValue, 3, "/") AS I)
DO CASE
CASE lnDay > 0 .AND. lnMon > 0 .AND. lnYr > 0
RETURN DATE(lnYr, lnMon, lnDay)
CASE lnDay > 0 .AND. lnMon > 0 .AND. lnYr = 0
RETURN DATE(YEAR(DATE()), lnMon, lnDay)
CASE lnDay > 0 .AND. lnMon = 0 .AND. lnYr = 0
RETURN DATE(YEAR(DATE()), MONTH(DATE()), lnDay)
OTHERWISE
RETURN DATE()
ENDCASE
ENDCASE