Good day,
I am trying to compare one date against another when DocAfiliado and PROGRAM are the same with this sentence:
if (DocAffiliated = Previous (DocAffiliated) and PROGRAM = Previous (PROGRAM), if (InMonth (Restorationdate, Previous (Restorationdate), 8), 'Out of range 8 months',' Within the 8 month range '),' Different document ') as Rank 8 months
But I want to be able to compare since they belong to the same DocAffiliate and PROGRAM to be able to compare the records by date against the first record or NumberFile = 1, I am trying to do so:
if (DocAffiliated = Previous (DocAffiliated) and PROGRAM = Previous (PROGRAM), if (InMonth (Restorationdate, Peek (Restorationdate, 0, 'Restorationdate'), 8), 'Outside the 8-month interval', 'Within the 8-month interval '),' Different document ') as Rank8 months
if someone give me a light i goint to be so much greatfull