Hi!
I have a problem. I need to retrieve records within a range. I’m using a super descriptor in a FIND and limiting the range with start and end values, as follows:
But when I run my code, it returns me many records with values for YEAR different that 2022… I don’t understand why. Could somebody point me, please, what I’m doing wrong or explain me the reason for this behaviour?
So you are doing a FIND of records between R2022 and S2022. Note that the Year is after the Flag so you are reading all R records from R2022 on and all S records up to and including S2022.
If you want only 2022 records, you would need a descriptor that has the year first.
Alternately, since R and S are sequential, you could write your FIND as:
FIND VIEW WITH SUPER = #SUPER-1-START OR = #SUPER-1-END
But that would only work in the special case where the flags you want are sequential and not so well if you are taking user input to fill your search keys.