What I'm trying to accomplish is removing duplicate records from a query based on the date/time stamp of the record.
Now for a little backstory, we have a table of data that is a log of every status change for an order and the date/time that the status change occured. We are trying to report off of this table to get turnaround times for processing orders.
Here's the table structure:
tblRAW
ID
ContractNo
Name
StatusDesc
Username
UpdateDateTime
Version
Now so far I have created several queries to seperate out the date/time stamps based on the StatusDesc field. We did this so that we could bring the Date/Time stamps back together into a single table/query and have seperate columns for each StatusDesc (Submitted, Accepted, Revised, etc.) which will be grouped on the ContractNo and Version fields.
The issue we have is that because some orders get submitted/revised and then get recalled before they can be processed only to be resubmitted/revised later, the log table ends up having duplicate records because the original new order or revision that was submitted never got processed but still generated a date/time stamp for it.
So what I'm trying to figure out is how to remove those duplicate records but I need to remove the earlier records rather than the later records, which is how Access seems to automatically handle duplicates.
Here's an example of the data that I'm seeing:
ContractNo
Here's an example of the data with the duplicates removed:
ContractNo
So let me know if you have any questions and any help will be greatly appreciated.
Travis
Charter Media
Now for a little backstory, we have a table of data that is a log of every status change for an order and the date/time that the status change occured. We are trying to report off of this table to get turnaround times for processing orders.
Here's the table structure:
tblRAW
ID
ContractNo
Name
StatusDesc
Username
UpdateDateTime
Version
Now so far I have created several queries to seperate out the date/time stamps based on the StatusDesc field. We did this so that we could bring the Date/Time stamps back together into a single table/query and have seperate columns for each StatusDesc (Submitted, Accepted, Revised, etc.) which will be grouped on the ContractNo and Version fields.
The issue we have is that because some orders get submitted/revised and then get recalled before they can be processed only to be resubmitted/revised later, the log table ends up having duplicate records because the original new order or revision that was submitted never got processed but still generated a date/time stamp for it.
So what I'm trying to figure out is how to remove those duplicate records but I need to remove the earlier records rather than the later records, which is how Access seems to automatically handle duplicates.
Here's an example of the data that I'm seeing:
ContractNo
Version
Name
StatusDesc
Username
UpdateDateTime
113814030
NCC
Submitted
jodoe
2/6/2015 10:31:53 AM
113814030
NCC
Submitted
jodoe
2/6/2015 10:40:21 AM
113814030
NCC
Accepted
jadoe
2/6/2015 10:50:45 AM
113814031
NCC
Revised
jodoe
2/7/2015 11:44:59 AM
113814031
NCC
Rev Accepted
jadoe
2/7/2015 12:12:09 AM
113814032
NCC
Revised
jodoe
2/12/2015 11:13:49 AM
113814032
NCC
Revised
jodoe
2/12/2015 11:20:15 AM
113814032
NCC
Rev Accepted
jadoe
2/12/2015 11:32:12 AM
Here's an example of the data with the duplicates removed:
ContractNo
Version
Name
StatusDesc
Username
UpdateDateTime
113814030
NCC
Submitted
jodoe
2/6/2015 10:40:21 AM
113814030
NCC
Accepted
jadoe
2/6/2015 10:50:45 AM
113814031
NCC
Revised
jodoe
2/7/2015 11:44:59 AM
113814031
NCC
Rev Accepted
jadoe
2/7/2015 12:12:09 AM
113814032
NCC
Revised
jodoe
2/12/2015 11:20:15 AM
113814032
NCC
Rev Accepted
jadoe
2/12/2015 11:32:12 AM
So let me know if you have any questions and any help will be greatly appreciated.
Travis
Charter Media