>SELECT AreaFK, StationFK, CrewFK, ; > MIN(EVL(nextminor,{^9999/12/31})) AS NextMinor, ; > MIN(EVL(nextmajor,{^9999/12/31})) AS NextMajor, ; > .F. AS doMinGroup, .F. AS doMajGroup ; > FROM premaint GROUP BY AreaFK, StationFK, CrewFK ; > INTO TABLE maintdue
NVL()
instead of EVL()
. I tested NVL()
and found that for an empty table.datefield it always returns the empty table.datefield and not the constant date supplied in the second parameter.SELECT
is the only place where it has to be converted to a non-blank date to apply the necessary logic to groups of records.