I am looking for a way to filter a field (Batch Name) with duplicate entries based on criteria involving another field in my query.
My database captures the time mail was received (in this case lets say 11:30) and a start time and an end time for various batches of documents being indexed (batches are created from received mail). What can happen is that a batch of 100 documents can be started but then interuppted requiring completion later. For example, an employee might open a batch of 100 documents at 7:45 and index 45 documents and stop at 8:10. The remaining 55 documents may be started at 8:30 and finished at 8:55. The result in my current query displays the same batch name with two separate start times and end times.
What I am trying to do is come up with a cycle time from when the mail was received to when the batch was completed. In my example I would want my query to filter out the 7:45 to 8:10 entry and only calculate my cycle time based on the finished time of 8:55 on my second entry. Right now I am getting two cycle times for the same batch.
Here is my current sqlview...
SELECT DISTINCTROW TeamWeb_Buckets.Recd_Date, TeamWeb_Buckets.BucketID, dbo_LogTable.EmpType, dbo_LogTable.BatchName, dbo_LogTable.TimeStarted, dbo_LogTable.TimeEnded, TimeValue(dbo_LogTable!TimeEnded) AS [End Time], ([ScanDate] & " " & [End Time]) AS [Batch End Time], DateDiff("n",[Recd_Date],[Batch End Time])/1440 AS [Elapsed Time], IIf(dbo_BucketBatches!Archiving=1,"Early Archiving","Late Archiving") AS [Early/Late], dbo_LogTable.Dept
FROM dbo_AutoBucket, TeamWeb_Buckets INNER JOIN (dbo_Prep INNER JOIN (dbo_Employees INNER JOIN ((dbo_Dept INNER JOIN dbo_BucketBatches ON dbo_Dept.deptID = dbo_BucketBatches.Dept) INNER JOIN dbo_LogTable ON (dbo_BucketBatches.Dept = dbo_LogTable.Dept) AND (dbo_BucketBatches.BatchName = dbo_LogTable.BatchName)) ON dbo_Employees.Name = dbo_LogTable.EmpName) ON dbo_Prep.BucketID = dbo_BucketBatches.BucketID) ON TeamWeb_Buckets.BucketID = dbo_Prep.BucketID
WHERE (((dbo_LogTable.EmpType)="INDEXER"))
ORDER BY TeamWeb_Buckets.Recd_Date DESC;
I am new to Access...Hopefully someone can help. Please let me know if clarification is needed.
Thank you
My database captures the time mail was received (in this case lets say 11:30) and a start time and an end time for various batches of documents being indexed (batches are created from received mail). What can happen is that a batch of 100 documents can be started but then interuppted requiring completion later. For example, an employee might open a batch of 100 documents at 7:45 and index 45 documents and stop at 8:10. The remaining 55 documents may be started at 8:30 and finished at 8:55. The result in my current query displays the same batch name with two separate start times and end times.
What I am trying to do is come up with a cycle time from when the mail was received to when the batch was completed. In my example I would want my query to filter out the 7:45 to 8:10 entry and only calculate my cycle time based on the finished time of 8:55 on my second entry. Right now I am getting two cycle times for the same batch.
Here is my current sqlview...
SELECT DISTINCTROW TeamWeb_Buckets.Recd_Date, TeamWeb_Buckets.BucketID, dbo_LogTable.EmpType, dbo_LogTable.BatchName, dbo_LogTable.TimeStarted, dbo_LogTable.TimeEnded, TimeValue(dbo_LogTable!TimeEnded) AS [End Time], ([ScanDate] & " " & [End Time]) AS [Batch End Time], DateDiff("n",[Recd_Date],[Batch End Time])/1440 AS [Elapsed Time], IIf(dbo_BucketBatches!Archiving=1,"Early Archiving","Late Archiving") AS [Early/Late], dbo_LogTable.Dept
FROM dbo_AutoBucket, TeamWeb_Buckets INNER JOIN (dbo_Prep INNER JOIN (dbo_Employees INNER JOIN ((dbo_Dept INNER JOIN dbo_BucketBatches ON dbo_Dept.deptID = dbo_BucketBatches.Dept) INNER JOIN dbo_LogTable ON (dbo_BucketBatches.Dept = dbo_LogTable.Dept) AND (dbo_BucketBatches.BatchName = dbo_LogTable.BatchName)) ON dbo_Employees.Name = dbo_LogTable.EmpName) ON dbo_Prep.BucketID = dbo_BucketBatches.BucketID) ON TeamWeb_Buckets.BucketID = dbo_Prep.BucketID
WHERE (((dbo_LogTable.EmpType)="INDEXER"))
ORDER BY TeamWeb_Buckets.Recd_Date DESC;
I am new to Access...Hopefully someone can help. Please let me know if clarification is needed.
Thank you