Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2009
    Posts
    2

    problem with query

    I am trying to help my friend with her homework. She has a small table created. her task was to pull the record with the earliest date. we grouped it by MIN and ran the query, it will only show the field I grouped by, I can not seem to get it to run if I select the rest of the fields. Can someone tell me what I am doing wrong? I need to be able to simply query the table and pull out the entire record for all dates matching the earliest... thank you

  2. #2
    CraigDolphin is offline Competent Performer
    Windows XP Access 2000
    Join Date
    Apr 2009
    Location
    Custer, WA, USA
    Posts
    125
    Simplest would be:

    Select Top 1 *
    From YourTableName
    Order By [DateFieldName] ASC;

  3. #3
    Join Date
    Apr 2009
    Posts
    2
    Problem with that is that there are an indeterminate number of records with the same MIN date... Hard to believe this is that difficult.... I have to be missing something. this is question 2 out of 10, and 3 through 10 are easy... alright, well if there are any other gurus out there that might have an idea what I am missing, let me know! thanks

  4. #4
    CraigDolphin is offline Competent Performer
    Windows XP Access 2000
    Join Date
    Apr 2009
    Location
    Custer, WA, USA
    Posts
    125
    Hang on. I thought you said you wanted to return exactly one record ("the record "), that has the minimum date value. The query I provided does that.

    If instead you mean that you want to return ALL records that happen to share the same date value as the minimum in the table, then that's a different question with a different answer.

    Select *
    From YourTableName
    Where ([DateFieldName] = DMin("[DateFieldName]","YourTableName"));

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Top 25 query problem
    By tmcrouse in forum Queries
    Replies: 3
    Last Post: 05-07-2009, 09:02 AM
  2. Problem in Query
    By Bruno Trindade in forum Queries
    Replies: 4
    Last Post: 03-28-2009, 04:10 PM
  3. Update Query problem
    By sollem1 in forum Queries
    Replies: 0
    Last Post: 11-08-2007, 10:16 AM
  4. problem with query size
    By acheo in forum Queries
    Replies: 0
    Last Post: 04-11-2007, 10:46 AM
  5. Is this a Query or Sorting problem?
    By bwrobel in forum Queries
    Replies: 2
    Last Post: 07-14-2006, 08:15 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums