Hi Mick!
I tried to move the numeric variables to D variables, but when I STOW the program, I receive an error, probably because I have to move to alphanumeric variables first… but my question is: is there a simple way to obtain a correct result (just like comparing the 2 numeric variables or is it necessary to move to alpha, and then to D variables to compare them)?

I agree with Ralph - your original comparison works fine.

If, as Ralph mentions, you want to compute elapsed time between two dates, D format is handy. Rather than moving the numeric dates to alpha, just redefine them:

As Ralph pointed out you can compare D/T to D/T variables directly (even to *DATX/*TIMX). Internally Date and Time variables are packed numbers representing the elapsed days/seconds from the beginning of time (as defined by Software AG or Copernicus - i.e. the beginning of the Gregorian Calendar in 1582). So that is why date arithmetic is easy and efficient.