:P Hello, this is my first post and I am new to coding so I need a lot of help :D I have an access query that has the following columns:
EMPNO EMPNAME DBA NUMHRS DATE INCDNT
EMPNO = NUMBER
EMPNAME = NAME
DBA = NUMBER
NUMHRS = NUMBER
DATE = DATE
INCDNT = Y OR N (just used for querying...all in this query are "N")
The columns are sorted in ascending order first by EMPNO then by DATE.
Is there a way to... have access look at the first EMPNO and if DBA is <> 999 then put a 1 in a new column then look at the second record in EMPNO. If this is EMPNO is the same as the previous, and DATE is equal to the date plus one in Record one then put a 1 in the new column field also. If the date is not equal to the previous date plus 1, then put a 2 in the new column field for that row. The number in the new column field would increment by 1 each time the date is not equal to the previous date plus one until a new EMPNO is reached. Then it would loop through this EMPNO and do the same until a new EMPNO is reached and continue until all records in the query have been looked at.
Thank you in advance for any assistance you can offer.
Foxhound
EMPNO EMPNAME DBA NUMHRS DATE INCDNT
EMPNO = NUMBER
EMPNAME = NAME
DBA = NUMBER
NUMHRS = NUMBER
DATE = DATE
INCDNT = Y OR N (just used for querying...all in this query are "N")
The columns are sorted in ascending order first by EMPNO then by DATE.
Is there a way to... have access look at the first EMPNO and if DBA is <> 999 then put a 1 in a new column then look at the second record in EMPNO. If this is EMPNO is the same as the previous, and DATE is equal to the date plus one in Record one then put a 1 in the new column field also. If the date is not equal to the previous date plus 1, then put a 2 in the new column field for that row. The number in the new column field would increment by 1 each time the date is not equal to the previous date plus one until a new EMPNO is reached. Then it would loop through this EMPNO and do the same until a new EMPNO is reached and continue until all records in the query have been looked at.
Thank you in advance for any assistance you can offer.
Foxhound