Results 1 to 8 of 8
  1. #1
    bchi99 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Oct 2014
    Posts
    23

    Issues with query results

    I have a query that groups and counts certain emails by a matter number. In my query I have selected a series of fields and one of the fields is received date in which i'd like the query to return the date of the oldest/first email as seen in the screen shot.


    Click image for larger version. 

Name:	design.jpg 
Views:	18 
Size:	26.0 KB 
ID:	18715

    Again, I want to show the oldest date of one of the grouped records but in the results it is showing me 11/12/2014 11:39 PM which isn't the oldest.

    Click image for larger version. 

Name:	error.JPG 
Views:	18 
Size:	17.6 KB 
ID:	18717

    Here are the email dates in this group of 3:

    Click image for larger version. 

Name:	dates.JPG 
Views:	18 
Size:	16.5 KB 
ID:	18716


    Shouldn't it show 11/12/2014 10:32 AM as the first received email and that date should be in the results???

    Anyone else run into this?

  2. #2
    burrina's Avatar
    burrina is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383
    Take a look at this link, it may help. https://support.office.com/en-us/art...rs=en-US&ad=US

  3. #3
    bchi99 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Oct 2014
    Posts
    23
    will that apply within this query? eventually this query will be a report.

  4. #4
    burrina's Avatar
    burrina is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383
    If it gets the results you want, then no problem, adjust as needed or else create a new query/report or change the record source dynamically!

  5. #5
    kagoodwin13 is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Feb 2012
    Posts
    181
    You've also got Total of First on your ID field as well. Access may be sorting by ID rather than by Received.

    You might be able to break up the steps into two queries, with the second query referencing the first. See the series of screenshots in the link below. I put the design view, then the datasheet view, for both queries. I think that is the output you are looking for. If not, let us know, and we can help you further.

    https://imgur.com/a/VhWEP

  6. #6
    TechRW is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2014
    Posts
    2
    Could use the query properties box to have the query display only the first or last as well

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Don't use First(), use Min().

    First() and Last() not always reliable for desired output. Usually Min() and Max() are what is needed.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  8. #8
    bchi99 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Oct 2014
    Posts
    23
    thanks min max worked.

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

Similar Threads

  1. Replies: 5
    Last Post: 05-21-2013, 02:21 PM
  2. Replies: 3
    Last Post: 05-02-2013, 10:36 AM
  3. Replies: 6
    Last Post: 05-14-2012, 07:24 AM
  4. Query issues
    By goosegoose35 in forum Access
    Replies: 1
    Last Post: 12-08-2011, 06:43 AM
  5. Query Issues: Multiplied Results
    By Sa'El in forum Access
    Replies: 1
    Last Post: 09-12-2011, 09:46 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