Hi
I have a file of CSV data which I want to import into an Access table. The table contains the following fields for each trainee record:
NI number, Surname, Forenames, Employer, TLO*, Date Finished, Day Count.
*TLO = Trainee Liaison Officer
The Date Finished is the date that the trainee finished a course.
The Day Count is: Current Date - Date Due End + 10000
(Date Due End is the predicted date that the trainee will finish the course. The reason 10000 is added to it is because the program which outputs the CSV data doesn't like negative numbers for some reason!)
The problem is that my database table uses the NI number as a key field, yet trainees may have done more than one course in the past two years (the range of the data), and so may have more than one record output. I want to just import the most recent data.
Below is an example of the CSV:
"JW988873B","Johnston","Desi Stephen","Burlington Toiletries","GW","01/11/00",10275
"JW988873B","Johnston","Desi Stephen","Burlington Toiletries","GW","",9728
It has the same NI, name, employer and TLO. The top one has a Date Finished, and a Day Count of 10275 (Due End was 275 days ago). The bottom one does not have a Date Finished, and the Day Count is 9728 (Due End is in 272 days). This last one is the most recent. So, I want to delete the top one and just import the last one.
Trainees may have more than two records too, occasionally (and I don't know why it does this), the same record is output twice - again, I only want to import one of them.
And just to complicate things further, when I import the data, I only want to import the following fields:
NI, Surname, Forenames, Employer, TLO
If I've managed to hold your attention this long, well done! If anyone can be of assistance, I would be grateful!
Thanks
I have a file of CSV data which I want to import into an Access table. The table contains the following fields for each trainee record:
NI number, Surname, Forenames, Employer, TLO*, Date Finished, Day Count.
*TLO = Trainee Liaison Officer
The Date Finished is the date that the trainee finished a course.
The Day Count is: Current Date - Date Due End + 10000
(Date Due End is the predicted date that the trainee will finish the course. The reason 10000 is added to it is because the program which outputs the CSV data doesn't like negative numbers for some reason!)
The problem is that my database table uses the NI number as a key field, yet trainees may have done more than one course in the past two years (the range of the data), and so may have more than one record output. I want to just import the most recent data.
Below is an example of the CSV:
"JW988873B","Johnston","Desi Stephen","Burlington Toiletries","GW","01/11/00",10275
"JW988873B","Johnston","Desi Stephen","Burlington Toiletries","GW","",9728
It has the same NI, name, employer and TLO. The top one has a Date Finished, and a Day Count of 10275 (Due End was 275 days ago). The bottom one does not have a Date Finished, and the Day Count is 9728 (Due End is in 272 days). This last one is the most recent. So, I want to delete the top one and just import the last one.
Trainees may have more than two records too, occasionally (and I don't know why it does this), the same record is output twice - again, I only want to import one of them.
And just to complicate things further, when I import the data, I only want to import the following fields:
NI, Surname, Forenames, Employer, TLO
If I've managed to hold your attention this long, well done! If anyone can be of assistance, I would be grateful!
Thanks