Results 1 to 9 of 9
  1. #1
    dfoster is offline Novice
    Windows 10 Access 2007
    Join Date
    Apr 2019
    Location
    DELETE THIS ACCOUNT
    Posts
    6

    Unhappy Why do records disappear?

    This seems simple, but I'm stumped. I have a query. Here is the design and resulting datasheet:

    Click image for larger version. 

Name:	No_Totals_design.jpg 
Views:	18 
Size:	18.7 KB 
ID:	38135
    Click image for larger version. 

Name:	No_Totals_datasheet.jpg 
Views:	18 
Size:	34.5 KB 
ID:	38134



    The problem arises when I add Totals. Here is the updated design and resulting datasheet:



    Click image for larger version. 

Name:	With_Totals_design.jpg 
Views:	18 
Size:	24.7 KB 
ID:	38136
    Click image for larger version. 

Name:	With_Totals_datasheet.jpg 
Views:	18 
Size:	17.5 KB 
ID:	38137


    In the datasheet with Total added, why aren't X3613 and X3991 appearing?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,919
    Date is a reserved word. Should not use reserved words as names for anything. Unexpected things can happen. May or may not be cause here.

    Otherwise, see nothing wrong. Post SQL statement. If you want to provide db for analysis, follow instructions at bottom of my post.
    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.

  3. #3
    dfoster is offline Novice
    Windows 10 Access 2007
    Join Date
    Apr 2019
    Location
    DELETE THIS ACCOUNT
    Posts
    6

    Reserved words fixed, stilll problem.

    Thank you. I updated two fields that were named using "reserved words." Query still not working. Attached (as per your instructions) for analysis. The query in question is "MAXodo_FY19_Q3".
    Attached Files Attached Files

  4. #4
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,654
    re-read question and deleted.

  5. #5
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,975
    First & Last don't always produce what you expect. Max/Min are more reliable
    In this case, you should use Where instead of Last for the Date field in the aggregate query.

    Code:
    SELECT Maintenance.License, Max(Maintenance.Odometer) AS MaxOfOdometer FROM Maintenance
    WHERE (((Maintenance.DateOfService) Between #1/1/2019# And #3/31/2019#))
    GROUP BY Maintenance.License
    ORDER BY Maintenance.License;
    Doing so gives the expected 9 records instead of the 7 you had
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,919
    Ooops, case of seeing what you expect - I did not notice the Last. I agree, Last and First are not reliable in most situations.
    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.

  7. #7
    dfoster is offline Novice
    Windows 10 Access 2007
    Join Date
    Apr 2019
    Location
    DELETE THIS ACCOUNT
    Posts
    6
    Wow. Yes, that works, thank you very much!

    I suppose as a side note.... As a person just learning this stuff, how common is it that "X doesn't work like you expect"? I feel like that's going to be a real stumbling block in learning to use Access, if I can expect to keep running into things that logically seem as though they'd work a certain way, but turn out not to....

  8. #8
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,799
    If I may, when you're presented with something that you've never reviewed for its usage, meaning, intent, etc. in Access, don't just use it - research it. While doing so with Last may not have revealed what's been told here, so many times people grab code, functions and methods and try to use them with no understanding of what those methods are supposed to do. However, even something as inconspicuous as Last ought to be researched. In other words, assume nothing and you will learn more and learn it faster than stumbling through an exercise.

  9. #9
    dfoster is offline Novice
    Windows 10 Access 2007
    Join Date
    Apr 2019
    Location
    DELETE THIS ACCOUNT
    Posts
    6
    Quote Originally Posted by Micron View Post
    If I may, when you're presented with something that you've never reviewed for its usage, meaning, intent, etc. in Access, don't just use it - research it. While doing so with Last may not have revealed what's been told here, so many times people grab code, functions and methods and try to use them with no understanding of what those methods are supposed to do. However, even something as inconspicuous as Last ought to be researched. In other words, assume nothing and you will learn more and learn it faster than stumbling through an exercise.
    Good advice, thank you.

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

Similar Threads

  1. Relations between tables disappear
    By BrightSoftware in forum Database Design
    Replies: 6
    Last Post: 04-03-2018, 07:06 AM
  2. Why does my form disappear in a split second? VBA
    By hrghauri in forum Programming
    Replies: 3
    Last Post: 07-26-2016, 09:26 AM
  3. table data disappear
    By edson in forum Access
    Replies: 1
    Last Post: 06-03-2015, 01:59 PM
  4. Report Totals Disappear...
    By tanyalee123 in forum Reports
    Replies: 1
    Last Post: 04-01-2015, 05:03 PM
  5. Replies: 6
    Last Post: 05-14-2013, 10:47 PM

Tags for this Thread

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