I have a procedure that scans my database to select the records of clients who should receive an annual reminder postcard. This procedure has been working for over a year. I enter the date to be selected as mm/1/yy, using the current year. The procedure uses monthmath( to subtract 12 months from the current year, and then uses monthlength( to determine the length of the month. This information then is used in datevalue( so that the correct dates for the 1st and last days of the month can be used to Select the appropriate records.
Today, I ran this procedure and found that datevalue( will cause an error when the months of August, October, or December are used. It does not accept the number 31 as a “day”. It does work properly when any of the other months with 31 days are entered, and it works with any of those months if “day” is set to 30.
This is the error message: datevalue( function: Illegal date, day must be from 1 to 30).
Since this procedure was working before upgrading to the Panorama X Pro 10.2.0.b24 (3860), I am curious to know if that has produced this change. I tried running this procedure in Panorama 10.1.2, but that Panorama closes before I can do anything with it. In any case, I will probably change the procedure to work around this problem, but any insight would be welcome
Below is a short procedure which produces the same error. (Sorry, but I can never remember how to properly add code to a post.)
let monthAndYearEntered = "" gettextsheet "Enter: mm/1/yy", monthAndYearEntered let firstOfMonthLastYear = monthmath(date(monthAndYearEntered), -12) message datestr(firstOfMonthLastYear) message monthlength(firstOfMonthLastYear) message datestr(datevalue(yearvalue(firstOfMonthLastYear), monthvalue(firstOfMonthLastYear), monthlength(firstOfMonthLastYear)))