A
al416
I have a table with a composite primary key made up of WaiverNumber, Code,
and CurrentYear.
WaiverNumber is a two digit sequential number from 01 to xx (not greater than
99).
Code is a unique code assigned to an individual (Joe is 08 and George is 06,
etc.).
CurrentYear is the current calendar year.
I need to increment WaiverNumber by 1 for each new record for each Code (or
individual) and reset code back to 01 for each new CurrentYear.
Ex: The first waiver for Code 08 (Joe) for the year 2009 needs to be 090801
(Year/Code/WaiverNumber). The next waiver for Code 08 needs to be 090802. The
first waiver for Code 06 (George) for the year 2009 needs to be 090601. In
2010 the WaiverNumber will reset to 01 and the Year wil change to 10 (ex.
100801, 100802, etc.)
I can use the DMax function to get the max waiver number, but how can I
further delineate the max waiver number for a particular individual (Code)
and start all over again in the new year?
and CurrentYear.
WaiverNumber is a two digit sequential number from 01 to xx (not greater than
99).
Code is a unique code assigned to an individual (Joe is 08 and George is 06,
etc.).
CurrentYear is the current calendar year.
I need to increment WaiverNumber by 1 for each new record for each Code (or
individual) and reset code back to 01 for each new CurrentYear.
Ex: The first waiver for Code 08 (Joe) for the year 2009 needs to be 090801
(Year/Code/WaiverNumber). The next waiver for Code 08 needs to be 090802. The
first waiver for Code 06 (George) for the year 2009 needs to be 090601. In
2010 the WaiverNumber will reset to 01 and the Year wil change to 10 (ex.
100801, 100802, etc.)
I can use the DMax function to get the max waiver number, but how can I
further delineate the max waiver number for a particular individual (Code)
and start all over again in the new year?