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.

LineCMDOTOperand 1OPEROTOperand2OTOperand3If Goto Else GoTo
00010 LETV BEGINNING OF YEAR BY $S PERIOD-END-DATE 00020
00020 LETVDAY OF YEARDBTVBEGINNING OF YEAR$SPERIOD-END-DATE00030

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).


Notes #

Click to create a new notes page