First/Last Sorting of Dates

G

Greg Blum

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.
 
B

Brian Camire

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.
 
B

Brian Camire

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).
 

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