G
Guest
Our payroll department uses a third-party database as a backend to a frontend
MS Access 2000 database with all linked tables. Every pay period they
generate a txt file that is sent to our financial department which contains a
list of all hours worked and the shift codes (A=Regular, B=Overtime, C =
Night shift overtime, etc.). A typical recordset would look like this:
ID Dept Hours ShiftCode
1 811233 80 A
2 812200 96 A
3 812203 8 B
4 812203 8 C
The problem I'm facing (and I'll confess, I'm not the brightest bulb in the
box when it comes to SQL/VBA), is that the report going out is showing
duplicate hours. What they need the txt file to show is:
ID Dept Hours ShiftCode
1 811233 80 A
2 812200 80 A
3 812203 8 B
4 812203 8 C
I need to go through each department's group of records (identified by the
first four characters in the department ID - the last two can't be stripped
out as they represent yet another code needed by Financial), and if there is
a ShiftCode of B or C, subtract that value from A and make that value
available in the txt file and hide the value of A that is stored in the
backend db. I'm not allowed to overwrite the values in the backend database.
I then need to perform this same action again for other sets of ShiftCodes
(fa/f1b, f2b, K/L, and so on).
I am allowed to do this anywhere in Access, as long as the results are
exportable as a txt file.
Any help (even referring me to a more appropriate newsgroup) would be very
welcome.
Thanks in advance,
Trisha
MS Access 2000 database with all linked tables. Every pay period they
generate a txt file that is sent to our financial department which contains a
list of all hours worked and the shift codes (A=Regular, B=Overtime, C =
Night shift overtime, etc.). A typical recordset would look like this:
ID Dept Hours ShiftCode
1 811233 80 A
2 812200 96 A
3 812203 8 B
4 812203 8 C
The problem I'm facing (and I'll confess, I'm not the brightest bulb in the
box when it comes to SQL/VBA), is that the report going out is showing
duplicate hours. What they need the txt file to show is:
ID Dept Hours ShiftCode
1 811233 80 A
2 812200 80 A
3 812203 8 B
4 812203 8 C
I need to go through each department's group of records (identified by the
first four characters in the department ID - the last two can't be stripped
out as they represent yet another code needed by Financial), and if there is
a ShiftCode of B or C, subtract that value from A and make that value
available in the txt file and hide the value of A that is stored in the
backend db. I'm not allowed to overwrite the values in the backend database.
I then need to perform this same action again for other sets of ShiftCodes
(fa/f1b, f2b, K/L, and so on).
I am allowed to do this anywhere in Access, as long as the results are
exportable as a txt file.
Any help (even referring me to a more appropriate newsgroup) would be very
welcome.
Thanks in advance,
Trisha