>My dear respected Sir,
>Thank you very much for helping me. The first solution meets my needs perfectly.
>Here is another issue.
>I have added a new column called "updown" in junk cursor.
>
>The logic is:
>Go top
>replace updown with 1
>
>Then
>if next row (qty) is greater then updown is equal to 1
>if next row (qty) is smaller then updown is equal to 0
>
>I need this result:
>
>The above code does not work in first group (column idid)
After this I'm going to start charging you by the hour. :-)
REPLACE idid WITH lnId, updown WITH IIF(qty >= lnLastQty, IIF(llGoingUp, 1, 0), 0)