Re: Group by (Selecting First) after Sorting



Ken

You posted in the tablesdbdesign newsgroup.

Your post seems to be a 'query'-related question. You'll get more focused
attention in the future if you post in the newsgroup dedicated to the topic.

You "have three fields" ... but you provided the values, not the field
names.

You mention a "transaction table" but don't describe it.

It all starts with the data ... and I don't have a very clear picture yet on
your data structure.

If you want a query that sorts by the first field (containing "Apple"), then
by the second field (containing either "Red" or "Green"), create a query,
pull in those fields, then use the SortBy category to do just that.

Or do I not yet understand your post?

Regards

Jeff Boyce
Microsoft Office/Access MVP


"Ken" <Ken@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:A420F10E-57A4-4C11-B5E9-6DB9B09E8374@xxxxxxxxxxxxxxxx
Hi,

I am trying to figure out a process from queries to obtain correct data
from
a table.

For example, I have 3 fields

Apple Red Big
Apple Green Small

Now I would like to obtain the 2nd row as a result (I do not want to use
individual criteria as I am working on a large transaction table with
history). So my logic is to create one query where I would sort this table
in
ascending order on the second field, which gives,

Apple Green Small
Apple Red Big

Then uses a second query (group by) on the first field, the rest using
(First from group by) to get the answer, but in the end I get the first
row
instead. What am I doing wrong here?









.



Relevant Pages

  • Re: Design View Criteria question
    ... The first query will use AND logic: it will return those records for which the ... first field is equal to 123 (regardless of the value in the second field), ...
    (microsoft.public.access.queries)
  • RE: IIf comparison
    ... How would I link this query to the report? ... > Qreate a query with the following equation ... >> where if the first field is greater in value than the second field, ... But if the first field is less in value ...
    (microsoft.public.access.reports)
  • Calculated fields in query
    ... I am stuck here and need some help with this one. ... The query returns the value 20 whereas it should return 0, ... as the first field value is 20 and the second field is ...
    (microsoft.public.access.queries)
  • Re: Ascending Sort Problem
    ... Create a query. ... In the first field put the following expression: ... In the second field, put this expression: ... In the third field, put this expression: ...
    (microsoft.public.access.queries)
  • Re: Query Only Creent Record?
    ... Running the query from the form does not work, it asks for the id number ... have been working on and has been saved when leaving the first field. ... report, which would be right. ... >> Memos Active, Orders Active, Memos Completed and Orders Completed. ...
    (microsoft.public.access.queries)