DBT - Days Between This operator takes the days between Operand 2 and Operand 3, and stores the result in Operand 1. This is calculated by subtracting the value in Operand 3 from the value in Operand 2. The value stored in Operand 1 will be either a positive or negative value. The number of months will be expressed as a fractional number. Statement: Find the number of days that have passed since the beginning of the year, store it into Variable Day of Year. Line CMD OT Operand 1 OPER OT Operand2 OT Operand3 If Goto Else GoTo 00010 LET V BEGINNING OF YEAR BY $S PERIOD-END-DATE 00020 00020 LET V DAY OF YEAR DBT V BEGINNING OF YEAR $S PERIOD-END-DATE 00030
Line 00010 calculates the first date of the year that the pay period end date falls. If the pay ends on February 18, 2000, the result in Beginning of Year operand is the date 01 Jan 2000. Line 00020 then calculates how many days there are between 01 Jan 2000 and 18 Feb 2000 (48).