I was doing some testing on date/time import and conversion functions we had written when I ran across a gotcha with the DATE function. It seems to be perfectly fine with non-numeric characters for the year portion of a date string, ignoring them completely and using whatever (leading) numeric are present. All of the following run with no errors:
MESSAGE DATE ("12/31/197x") VIEW-AS ALERT-BOX INFORMATION. /* year is assumed to be 197 */
MESSAGE DATE ("12/31/19xx") VIEW-AS ALERT-BOX INFORMATION. /* year is assumed to be 19 */
MESSAGE DATE ("12/31/1xxx") VIEW-AS ALERT-BOX INFORMATION. /* year is assumed to be 1 */
MESSAGE DATE ("12/31/wxyz") VIEW-AS ALERT-BOX INFORMATION. /* year is assumed to be the current year */
MESSAGE DATE ("12/31/x977") VIEW-AS ALERT-BOX INFORMATION. /* year is assumed to be the current year */
Just my fun fact for the day.
MESSAGE DATE ("12/31/197x") VIEW-AS ALERT-BOX INFORMATION. /* year is assumed to be 197 */
MESSAGE DATE ("12/31/19xx") VIEW-AS ALERT-BOX INFORMATION. /* year is assumed to be 19 */
MESSAGE DATE ("12/31/1xxx") VIEW-AS ALERT-BOX INFORMATION. /* year is assumed to be 1 */
MESSAGE DATE ("12/31/wxyz") VIEW-AS ALERT-BOX INFORMATION. /* year is assumed to be the current year */
MESSAGE DATE ("12/31/x977") VIEW-AS ALERT-BOX INFORMATION. /* year is assumed to be the current year */
Just my fun fact for the day.