First/Last Sorting of Dates

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

Guest

I have a very simple query that works on a table that has Date/Time and Batch Number as Fields. In the TOTAL criteria in design view I have 1 column as FIRST and 1 column as LAST. The query gives me the exact opposite. I have what appears to be an identical query running on another machine and it runs correctly.
 
Try using Min and Max instead. Despite their names, First and Last
effectively return arbitrarily selected values.

Also, is the data type of either of your fields Text? Values in Text fields
may not sort the way you would want if you are using them to store dates
and/or numbers.

Greg Blum said:
I have a very simple query that works on a table that has Date/Time and
Batch Number as Fields. In the TOTAL criteria in design view I have 1
column as FIRST and 1 column as LAST. The query gives me the exact opposite.
I have what appears to be an identical query running on another machine and
it runs correctly.
 
When you don't care which value is selected, like when you know that the
values are the same for all the records in each group (as defined by the
GROUP BY clause).
 
Back
Top