Hi all,
I am using MS SQL and I need help with creating a column were I can add a sequantial numbering of groups of records based on sequantial dates. The table structure is as follows
MemberID EnrollDate TermDate
001 01/01/2005 05/30/2005
001 07/01/2005 09/30/2005
001 10/15/2005 12/31/2005
002 01/12/2005 06/30/2005
002 07/15/2005 12/30/2005
003 02/01/2005 08/30/2005
003 09/01/2005 12/25/2005
I need this table to look like this
MemberID EnrollDate TermDate Seq_Number
001 01/01/2005 05/30/2005 1
001 07/01/2005 09/30/2005 2
001 10/15/2005 12/31/2005 3
002 01/12/2005 06/30/2005 1
002 07/15/2005 12/30/2005 2
003 02/01/2005 08/30/2005 1
003 09/01/2005 12/25/2005 2
I'll appreciate any advice to help me resolve this problem.
Cgarmas
I am using MS SQL and I need help with creating a column were I can add a sequantial numbering of groups of records based on sequantial dates. The table structure is as follows
MemberID EnrollDate TermDate
001 01/01/2005 05/30/2005
001 07/01/2005 09/30/2005
001 10/15/2005 12/31/2005
002 01/12/2005 06/30/2005
002 07/15/2005 12/30/2005
003 02/01/2005 08/30/2005
003 09/01/2005 12/25/2005
I need this table to look like this
MemberID EnrollDate TermDate Seq_Number
001 01/01/2005 05/30/2005 1
001 07/01/2005 09/30/2005 2
001 10/15/2005 12/31/2005 3
002 01/12/2005 06/30/2005 1
002 07/15/2005 12/30/2005 2
003 02/01/2005 08/30/2005 1
003 09/01/2005 12/25/2005 2
I'll appreciate any advice to help me resolve this problem.
Cgarmas