Use the shift(X;Y) function instead of arithmetic expressions when dealing with dates.

Information on using shift(X;Y) can be found in the Documentation Center here: shift(X;Y)

The appropriate date-shifted equivalent of {@today_}-1 is shift({@today_},-1)


The following operation which selects yesterday's date from a 'date' column:

<sel value="date={@today_}-1"/> 

Should be changed to:

<sel value="date=shift({@today_};-1)"/> 

Additional Information:

Arithmetic expressions (addition, subtraction, etc.) should be avoided with dates, since dates are stored in YYYYMMDD format and are treated as plain integers in arithmetic equations.

While the expression {@today_}-1 will accurately return yesterday's date most of the time, when "yesterday" is in the previous month (i.e., the operation is run on the 1st of the month), the integer date value minus one will not return a valid date. 

For example, when "today" is 20190501 (May 1st 2019), the expression {@today_}-1 is evaluated as 20190501 (-1) = 20190500. This is not a valid date, and the expected value is actually 20190430 (April 30th 2019).

All arithmetic expressions performed on dates may return invalid or unexpected results. Therefore, it is necessary to use shift(X;Y) instead of addition or subtraction to accurately shift dates in 1010data Macrolanguage.