Looking for a Query Wizard

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello all,

I need help with a query that will look for the first record and a last
record of a group. I tried the DFirst and DLast. Is this what I should use?
and if so can someone show me some examples.

the table has "TimeIn" and I need a First & Last For each individual
RouteNumber in my Table "Tbl_Reefer_Tracking".

Any Help is Greatly Appreciated,

Charlie
 
It's enough to drive someone to reefer madness! DFirst, First, DLast, and
Last are all about worthless unless the recordset is sorted first. Assuming
that the TimeIn field is an actual date/time datatype, Min and Max are much
better.

SELECT Tbl_Reefer_Tracking.RouteNumber,
Min(Tbl_Reefer_Tracking.TimeIn) AS MinOfTimeIn,
Max(Tbl_Reefer_Tracking.TimeIn) AS MaxOfTimeIn
FROM Tbl_Reefer_Tracking
GROUP BY Tbl_Reefer_Tracking.RouteNumber;
 

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

Back
Top