I'm assuming that you have an index on Group and Date (Grp + DTOS(date))
SELECT myTable
SET ORDER TO CorrectTag
GO TOP
m.grp = grp
DO WHILE grp = m.grp AND NOT EOF()
m.date = date
m.sno = 0
DO WHILE m.grp = grp AND m.date = date AND NOT EOF()
m.sno = m.sno + 1
REPLACE sno WITH m.sno
SKIP
ENDDO
m.grp = grp
ENDDO
>Dear Experts
>
>Table1 has following three fields
>
>grp c(1)
>sno n(3)
>date d()
>
>Data in table1 is as
>
>A, 5, 01-12-2005
>A, 1, 01-12-2005
>A, 3, 01-12-2005
>B, 2 01-12-2005
>B, 4, 01-12-2005
>
>I want to replace sno according to unique grp, in same date, as follows
>
>A, 1, 01-12-2005 && here sno will replace by 1
>A, 2, 01-12-2005
>A, 3, 01-12-2005
>B, 1, 01-12-2005 && here sno will replace by 1 again
>B, 2, 01-12-2005
>
>Grp,A,B, means group.
>Every new group must start with 1 and should continue increasing by 1 till
>end of same date.
>
>There are diffrent dates in table1.
>
>Please help