Min Date/Time in Audit Trail Table

G

Guest

Hi!
I think this should be fairly easy but I can't seem to wrap my brain around
it today!!

I am linked to a table that provides an EXTREMELY basic audit trail for work
tasks. Unfortunatly, for me, I cannot modify the table in any way.
The table structure and data is:
task_nbr assigned_to datetime
431526 AB7829 10/16/2007 12:52:01 PM
431526 AB7829 10/16/2007 1:12:37 PM
431526 CD4589 10/17/2007 10:17:58 AM
431526 CD4589 10/17/2007 10:18:00 AM
431938 AB2695 10/16/2007 11:39:47 AM
431938 AB2695 10/16/2007 11:39:49 AM
432206 EG0746 10/15/2007 12:39:05 PM
432206 EG0746 10/15/2007 12:40:12 PM
432206 EG0746 10/15/2007 12:50:57 PM
432206 CD1101 10/15/2007 12:50:59 PM
432254 HL1390 10/15/2007 11:30:32 AM
432254 HL1390 10/15/2007 11:55:59 AM

What I would like to create a query to extract is the first (Min) date/time
for each record where the task_nbr & assigned_to are the same.
The result from the data above:
task_nbr assigned_to datetime
431526 AB7829 10/16/2007 12:52:01 PM
431526 CD4589 10/17/2007 10:17:58 AM
431938 AB2695 10/16/2007 11:39:47 AM
432206 EG0746 10/15/2007 12:39:05 PM
432206 CD1101 10/15/2007 12:50:59 PM
432254 HL1390 10/15/2007 11:30:32 AM

Thanks in advance for any help provided!
 
G

Guest

TRy this ---
SELECT Molasses26.task_nbr, Molasses26.assigned_to, Min(Molasses26.datetime)
AS MinOfdatetime
FROM Molasses26
GROUP BY Molasses26.task_nbr, Molasses26.assigned_to;
 
G

Guest

Works like a charm! Thanks!

KARL DEWEY said:
TRy this ---
SELECT Molasses26.task_nbr, Molasses26.assigned_to, Min(Molasses26.datetime)
AS MinOfdatetime
FROM Molasses26
GROUP BY Molasses26.task_nbr, Molasses26.assigned_to;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top